Browse Source

add delimiter as option

pull/9/head
vargburz 2 years ago
parent
commit
8baef721d8
  1. 2
      src/services/exporter.ts
  2. 1
      src/types.ts

2
src/services/exporter.ts

@ -109,7 +109,7 @@ export class Exporter {
} }
private _initCsvStream() { private _initCsvStream() {
const csvStream = csv.createWriteStream({ headers: true }) const csvStream = csv.createWriteStream({ headers: true, delimiter: this._task.csvDelimiter })
.on('error', async e => await this._updateProgress({ status: ExportStatus.ERROR, errorMessage: e.message })); .on('error', async e => await this._updateProgress({ status: ExportStatus.ERROR, errorMessage: e.message }));
const writableStream = fs.createWriteStream(this._getFilePath('csv')); const writableStream = fs.createWriteStream(this._getFilePath('csv'));

1
src/types.ts

@ -102,6 +102,7 @@ export type ExportTask = {
from: number; from: number;
to: number; to: number;
}; };
csvDelimiter: string;
progress?: ExportProgress; progress?: ExportProgress;
id?: string; id?: string;
}; };

Loading…
Cancel
Save