Convert lines of JSON data to CSV

npm install jsontocsv
1 downloads in the last day
3 downloads in the last week
27 downloads in the last month

Node.js - jsontocsv

Convert lines of JSON data to CSV.


It's very convenient to write Node.js scripts that dump out a serialized object to a line. Most text processing utilities though cannot handle data like this. However, many can handle CSV files.


npm install jsontocsv


var jsontocsv = require('jsontocsv')

jsontocsv(inputStream, outputStream, {header: false, whitelist: whitelistFields}, function (err) {
  if (!err) console.log('Success.')

Command Line

  Usage: jsontocsv [options]


    -h, --help                 output usage information
    -V, --version              output the version number
    -b, --blacklist [fields]   Prevent blacklisted fields from output, otherwise all will be used.
    -w, --whitelist [fields]   Only allow whitelisted fields in output, otherwise all will be used.
    -i, --input [file]         Input file. Otherwise STDIN.
    -o, --output [file]        Output file. Otherwise STDOUT.
    -h, --header [true/false]  If set to the true, the CSV header will be output. Defaults to true.

Alternatives Node.js Packages:


(MIT License)

Copyright 2013, JP Richardson jprichardson@gmail.com

npm loves you