Detects tabular data (dsv, json, ndjson, xls, xlsx, xml, ods or sylk) and emits objects. Memory efficient for spreadsheets if PHP is available (weird huh), but does not require it. Spreadsheets and DSV must have a header.
var tabular = require('tabular-stream')
, fs = require('fs')
, JSONStream = require('jsonstream')
fs.createReadStream('test/air_pollution_nl.xlsx')
.pipe( tabular() )
.pipe( JSONStream.stringify() )
.pipe( process.stdout )
Returns a duplex stream - give it any tabular data, get back objects.
- DSV (CSV, TSV or anything) through csv-parser
- JSON and NDJSON through JSONStream
And through excel-stream or phpexcel-stream:
- Office Open XML (.xlsx) (Excel 2007 and above)
- SpreadsheetML (.xml) (Excel 2003)
- BIFF 5-8 (.xls) (Excel 95 and above)
- Open Document Format/OASIS (.ods)
- SYLK
It actually supports even more formats - depending on whether excel-stream or phpexcel-stream is used - but only the shared formats are listed here.
With npm do:
npm install tabular-stream
MIT © Vincent Weevers. Test data © Statistics Netherlands, The Hague/Heerlen.