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
npm i -g ndjson-2-json
# 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