Browse Source

Merge pull request 'add delimiter as option' (#9) from handle-optional-csv-delimeters into master

Reviewed-on: #9
pull/10/head
vargburz 2 years ago
parent
commit
7527ead9c5
  1. 2
      package.json
  2. 2
      src/services/exporter.ts
  3. 1
      src/types.ts

2
package.json

@ -1,6 +1,6 @@
{
"name": "grafana-data-exporter",
"version": "0.7.1",
"version": "0.7.2",
"description": "Server for fetching data from Grafana datasources",
"scripts": {
"start": "node dist/server.js",

2
src/services/exporter.ts

@ -109,7 +109,7 @@ export class Exporter {
}
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 }));
const writableStream = fs.createWriteStream(this._getFilePath('csv'));

1
src/types.ts

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

Loading…
Cancel
Save