excel-stream

convert a stream of xls or xlsx into json on the command line or in node

npm install excel-stream
2 downloads in the last day
63 downloads in the last week
178 downloads in the last month

excel-stream

A stream that converts excel spreadsheets into JSON object arrays.

Example

var excel = require('excel-stream')
var fs = require('fs')

fs.createReadStream('accounts.xlsx')
  .pipe(excel())
  .on('data', console.log)

Usage

npm install -g excel-stream
excel-stream < accounts.xlsx > account.json

formats

each row becomes a javascript object, so input like

foo, bar, baz
  1,   2,   3
  4,   5,   6

will become

[{
  foo: 1,
  bar: 2,
  baz: 3
}, {
  foo: 4,
  bar: 5,
  baz: 6
}]

Don't Look Now

So, excel isn't really a streamable format. But it's easy to work with streams because everything is a stream. This writes to a tmp file, then pipes it through the unfortunately named j then into csv-stream

License

MIT

npm loves you