A stream that converts excel spreadsheets into JSON object arrays.
var excel = require('excel-stream')
var fs = require('fs')
fs.createReadStream('accounts.xlsx')
.pipe(excel())
.on('data', console.log)npm install -g excel-stream
excel-stream < accounts.xlsx > account.jsonnewline delimited json:
excel-stream --newlineseach row becomes a javascript object, so input like
foo, bar, baz
1, 2, 3
4, 5, 6will become
[{
foo: 1,
bar: 2,
baz: 3
}, {
foo: 4,
bar: 5,
baz: 6
}]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
MIT