@kszongic/csv2json-cli
v1.0.0
Published
Convert CSV to JSON from the command line — pipe-friendly, zero dependencies
Maintainers
Readme
@kszongic/csv2json-cli
Convert CSV to JSON from the command line. Zero dependencies, pipe-friendly, handles quoted fields.
Install
npm install -g @kszongic/csv2json-cliUsage
# Convert a file
csv2json data.csv
# Pipe from stdin
cat data.csv | csv2json
# Custom delimiter
csv2json -d ";" data.csv
# Array of arrays (skip header mapping)
csv2json --array data.csv
# Compact output
csv2json --compact data.csvExample
input.csv:
name,age,city
Alice,30,NYC
Bob,25,"San Francisco"$ csv2json input.csv
[
{ "name": "Alice", "age": "30", "city": "NYC" },
{ "name": "Bob", "age": "25", "city": "San Francisco" }
]Options
| Flag | Description |
|------|-------------|
| -d, --delimiter <char> | Column delimiter (default: ,) |
| --array | Output as array of arrays |
| --compact | Minified JSON |
| --pretty | Pretty-printed JSON (default) |
| -v, --version | Show version |
| -h, --help | Show help |
License
MIT © 2026 kszongic
