downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
nodeany
cjs
keywords
Tagged topics.
csvjsoncsv2jsoncsvtojsonstream
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Stream and CLI to convert CSV to JSON.
Installation of the npm package:
Install globally if you want to use the CLI:
npm install --global csv2jsonInstall locally if you want to use it as a library:
npm install --save csv2jsonUsage: csv2json [OPTIONS] [<input file> [<output file>]]
-d, --dynamic-typing
Convert booleans and numeric to their type instead of strings.
-s <separator>, --separator=<separator>
Field separator to use (default to comma “,”).
-t, --tsv
Use tab as separator, overrides separator flag.
<input file>
CSV file to read data from.
If unspecified or a dash (“-”), use the standard input.
<output file>
JSON file to write data to.
If unspecified or a dash (“-”), use the standard output.var csv2json = require('csv2json');
var fs = require('fs');
fs.createReadStream('data.csv')
.pipe(csv2json({
// Defaults to comma.
separator: ';'
}))
.pipe(fs.createWriteStream('data.json'));Contributions are very welcomed, either on the documentation or on the code.
You may:
Thanks to @twilson63 for letting me use the csv2json name on npm.
ISC © Julien Fontanet
Estimated unpacked size across 29 packages.
853.7 kB
Includes dependencies.
julien-f
julien.fontanet@isonoe.net
^2.0.0
2.0.1
^1.2.0
1.2.8
^3.0.1
5.0.12
^2.3.0
3.2.1