Csv2json
Simple and fast streaming CSV to JSON converter
Install / Use
/learn @julien-f/Csv2jsonREADME
csv2json
Looking for maintainers, drop a message in this issue.
Stream and CLI to convert CSV to JSON.
Install
Installation of the npm package:
Install globally if you want to use the CLI:
npm install --global csv2json
Install locally if you want to use it as a library:
npm install --save csv2json
Usage
CLI
Usage: 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.
Stream
var csv2json = require('csv2json');
var fs = require('fs');
fs.createReadStream('data.csv')
.pipe(csv2json({
// Defaults to comma.
separator: ';'
}))
.pipe(fs.createWriteStream('data.json'));
Contributions
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.
Note
Thanks to @twilson63 for letting me use the csv2json name on npm.
License
ISC © Julien Fontanet
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

