/json-to-csv-stream

Convert a JSON array stream into CSV rows

Primary LanguageJavaScriptMIT LicenseMIT

json-to-csv-stream Build Status

Convert a JSON array stream into CSV rows

Install

$ npm install --save json-to-csv-stream

Usage

var jsonToCsv = require('json-to-csv-stream')
var fs = require('fs')

fs.createReadStream('./data.json')
  .pipe(jsonToCsv())
  .pipe(fs.createWriteStream('./data.csv'))

API

jsonToCsvStream(options) -> Transform

options

Type: object
Default: {}

path

Type: any Default: undefined

A path for JSONStream.parse.

csv

Type: object
Default: undefined

Options to pass to csv-write-stream.

License

MIT © Ben Drucker