當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript csv-stringify類代碼示例

本文整理匯總了TypeScript中csv-stringify的典型用法代碼示例。如果您正苦於以下問題:TypeScript csv-stringify類的具體用法?TypeScript csv-stringify怎麽用?TypeScript csv-stringify使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了csv-stringify類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createWriteStream

 static createWriteStream(dest: string, opts: WriteOptions = {}): CSVWriteStream {
   if (!opts.delimiter) opts.delimiter = this.getDefaultDelimiter(dest);
   const stringifyOptions = this.getStringifyOptions(opts);
   const stringifyTransform = stringify(stringifyOptions);
   stringifyTransform.pipe(createWriteStream(dest));
   return stringifyTransform;
 }
開發者ID:DrDanRyan,項目名稱:csv-translator,代碼行數:7,代碼來源:index.ts

示例2: csvStringify

 return new Promise<string>((resolve, reject) => {
   csvStringify(rows, (error, output) => {
     if (error) {
       reject(error);
     } else {
       resolve(output);
     }
   });
 });
開發者ID:danvk,項目名稱:localturk,代碼行數:9,代碼來源:csv.ts

示例3: write

 static write(dest: string, data: any[], arg1: any, arg2?: any): void {
   const writeOptions = arg2 ? arg1 : {};
   const cb = arg2 ? arg2 : arg1;
   if (!writeOptions.delimiter) writeOptions.delimiter = this.getDefaultDelimiter(dest);
   const stringifyOptions = this.getStringifyOptions(writeOptions, data);
   const nestedArrayData = this.getNestedArrayData(data, stringifyOptions.columns);
   stringify(nestedArrayData, stringifyOptions, (err, stringData) => {
     if (err) { return cb(err); }
     writeFile(dest, stringData, cb);
   });
 }
開發者ID:DrDanRyan,項目名稱:csv-translator,代碼行數:11,代碼來源:index.ts

示例4: csvStringify

services.history.onNewRecord.subscribe(record => csvStringify(
    [Object.values(record)],
    (_error, output) => appendFileSync(historyFilePath, output),
));
開發者ID:sunyton,項目名稱:upterm,代碼行數:4,代碼來源:SaveHistory.ts

示例5: stringify

 static stringify(data: any[], opts: WriteOptions, cb: ResultCb<string>) {
   if (!opts.delimiter) opts.delimiter = ',';
   const stringifyOptions = this.getStringifyOptions(opts, data);
   const nestedArrayData = this.getNestedArrayData(data, stringifyOptions.columns);
   stringify(nestedArrayData, stringifyOptions, cb);
 }
開發者ID:DrDanRyan,項目名稱:csv-translator,代碼行數:6,代碼來源:index.ts


注:本文中的csv-stringify類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。