jtocsv
v1.0.7
Published
A small library that will read all the JSON files from the folder, flatten them, and convert them to CSV file
Downloads
92
Maintainers
Readme
Jtocsv (JSON to CSV parser)
Jtocsv is an npm package that reads the JSON files from a folder path, parses and flattens the data and combines the data in the output CSV file. It provides flexibility through command-line arguments. CSV headers are formed on flattened JSONs keys.
Installation
npm install -g jtocsv
Usage
jtocsv [options]
Command-Line Options
path: (Required) Path to the folder containing JSON files (objects or JSON arrays).
path: (Required) Path to the output CSV file.
Examples
Read all JSON files and save the parsed data to CSV file:
jtocsv /path/to/jsons /path/to/output.csv
Inline
import { saveJSONSToCSV } from 'jtocsv/parser.js'
await saveJSONSToCSV('json_path', 'csv_path')
Contributing
Contributions are welcome!