cold-sweat

Massage csv data into a specific json format

npm install cold-sweat
2 downloads in the last week
22 downloads in the last month

node-cold-sweat

Massage csv data into a specific json format

Pipe a stream of csv, and this returns a JSON object holding the properties. The returned object looks like this:

{
  graph: {
    title:
    datasequences: [ {
        title: <csv row 1, column n + 1>
        datapoints: [ {
            title:
            value:
          }, ...
        ]
      }
      ...
    ]
  }
}

Example

var sweat = require('cold-sweat')
  , fs = require('fs')

fs.createReadStream('./data.csv').pipe(sweat(function (err, result) {
  console.log(JSON.stringify(result))

})
npm loves you