csv-to-ndjson
Convert a CSV file to ndjson format stream or file.
Install
$ npm install csv-to-ndjson
Usage
const csvToNdjson = ;
API
csvToNdjson(input, [options])
path
Type: string
Path of the CSV file to be read. The file has to end with the .csv
file extension.
options
destination
Type: string
When destination exists on the options object, the results of the transformation are persisted in a file. When a destination is specified the function doesn't return a readable stream but a promise when the file is written.
delimiter
Type: char
Default: ,
If the CSV uses ;
delimiter instead of ,
then this needs to be declared explicitly in the options object.
header
Type: String[]
When you want to use custom attribute names and not the headers of the CSV file as attribute names, then you can specify an array of attribute names.
License
MIT © Simon