![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
excel-stream
Advanced tools
convert a stream of xls or xlsx into json on the command line or in node
A stream that converts excel spreadsheets into JSON object arrays.
// stream rows from the first sheet on the file
var excel = require('excel-stream')
var fs = require('fs')
fs.createReadStream('accounts.xlsx')
.pipe(excel()) // same as excel({sheetIndex: 0})
.on('data', console.log)
// stream rows from the sheet named 'Your sheet name'
var excel = require('excel-stream')
var fs = require('fs')
fs.createReadStream('accounts.xlsx')
.pipe(excel({
sheet: 'Your sheet name'
}))
.on('data', console.log)
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).npm install -g excel-stream
excel-stream < accounts.xlsx > account.json
newline delimited json:
excel-stream --newlines
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
}]
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
FAQs
convert a stream of xls or xlsx into json on the command line or in node
The npm package excel-stream receives a total of 107 weekly downloads. As such, excel-stream popularity was classified as not popular.
We found that excel-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.