Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ csvMerger.merge(inputFiles, options);
options = {
outputPath, // string: path to the output CSV file
writeOutput, // boolean: if true, the output will be written to a file, otherwise will be returned by the function
quoted, // boolean: if true will wrap all values in quotes, otherwise values will be unquoted
}
```

Expand Down
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function formOptions(partialOptions: Partial<IMergeOptions>): IMergeOptions {
commandLineExecution: false,
outputPath: 'merged.csv',
writeOutput: false,
quoted: false,
},
...partialOptions,
};
Expand Down
2 changes: 1 addition & 1 deletion src/csv/write_with_columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function writeWithColumns(
const readStream = fs.createReadStream(inputFile);

const csvParesr = csvParse({ columns: true });
const csvStringifier = csvStringify({ header: isFirstOutput, columns: uniqueColumns });
const csvStringifier = csvStringify({ header: isFirstOutput, columns: uniqueColumns, quoted: options.quoted });

const outputStream = readStream
.pipe(csvParesr)
Expand Down
1 change: 1 addition & 0 deletions src/types/merge_options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface IMergeOptions {
commandLineExecution: boolean;
outputPath: string;
writeOutput: boolean;
quoted: boolean;
}