A command-line utility and Ruby gem for converting JSON files to CSV, and CSV files to JSON (soon).
You can install json-csv as a Ruby Gem:
gem imstall json-csv
Or as a standalone command-line script:
# Systemwide install
curl https://raw.githubusercontent.com/appcues/json-csv/master/lib/json_csv.rb | sudo tee /usr/local/bin/json-csv >/dev/null
sudo chmod a+x /usr/local/bin/json-csv
# Single-user install
curl https://raw.githubusercontent.com/appcues/json-csv/master/lib/json_csv.rb > json-csv
chmod +x json-csv
Run json-csv -h
to see execution options.
-
Customizable: Max nested data depth, line endings, etc
-
CSV output is sorted by depth and alphabet
-
Zero dependencies outside core Ruby 2.x
-
Easy install
json-csv is copyright 2017, Appcues, Inc.
This code is released under the [https://opensource.org/licenses/MIT](MIT License).