excel-stream
A stream that converts excel spreadsheets into JSON object arrays.
Examples
// stream rows from the first sheet on the filevar excel =var fs =fs// same as excel({sheetIndex: 0})
// stream rows from the sheet named 'Your sheet name'var excel =var fs =fs
stream options
The options
object may have the same properties as csv-stream and these two additional properties:
sheet
: the name of the sheet you want to stream. Case sensitive.sheetIndex
: the sheet number you want to stream (0-based).
Usage
npm install -g excel-streamexcel-stream < accountsxlsx > accountjson
options
newline delimited json:
excel-stream --newlines
formats
each row becomes a javascript object, so input like
foo, bar, baz1, 2, 34, 5, 6
will become
foo: 1bar: 2baz: 3foo: 4bar: 5baz: 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