Skip to content

Convert newline delineated JSON to a CSV for easy consumption.

License

Notifications You must be signed in to change notification settings

cameronwp/ndjson-to-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ndjson-to-csv

This is a specific example of converting an NDJSON to CSV file, not a generic tool. You'll notice that there are hardcoded headers from the only subfield I was interested in parsing.

Specifically, this example demonstrates transforming an exported PouchDB database (produced by PouchDB Replication Stream) to a CSV file. My docs had variable keys on them, so I hardcoded all of the possible keys to ensure that every entry was written to the CSV (csv-write-stream will assume the first entry has the correct headers and ignore headers on subsequent entries if they differ).

Usage

Install.

npm i

Run.

node . path/to/input.txt path/to/output.csv

About

Convert newline delineated JSON to a CSV for easy consumption.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published