fixed export from Mongo into Excel and CSV #240

This commit is contained in:
Jan Prochazka 2022-02-28 18:25:22 +01:00
parent 2a1e9a6ddd
commit b0e0cf1829
2 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ async function writer({ fileName, encoding = 'utf-8', header = true, delimiter,
csvPrepare.pipe(csvStream);
csvStream.pipe(fileStream);
csvPrepare['finisher'] = fileStream;
csvPrepare.requireFixedStructure = true;
return csvPrepare;
}

View File

@ -24,6 +24,7 @@ class ExcelSheetWriterStream extends stream.Writable {
this.structure = null;
this.fileName = fileName;
this.sheetName = sheetName;
this.requireFixedStructure = true;
}
_write(chunk, enc, next) {
if (this.structure) {