Skip to content

minimal CLI converter from newline-delimited JSON to a JSON array

Notifications You must be signed in to change notification settings

maxlath/ndjson-2-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

See also

About

minimal CLI converter from newline-delimited JSON to a JSON array

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published