ndjson-2-json
v1.0.2
Published
Minimal CLI converter from newline-delimited JSON to a JSON array
Downloads
5
Maintainers
Readme
ndjson-2-json
Minimal CLI converter from newline-delimited JSON to a JSON array
Features:
- converts NDJSON to JSON
- uses streams to be able to handle very large files with minimal memory use
- zero validation: you have the responsability to send some proper newline-delimited JSON on
ndjson-2-json
stdin
Install
npm i -g ndjson-2-json
How to
# Convert all a file
cat some.ndjson | ndjson-2-json > some.json
# which can also be written
ndjson-2-json < some.ndjson > some.json
# Convert just the 20 first lines
head -n 20 some.ndjson | ndjson-2-json > 20_first_entries.json