Socket
Socket
Sign inDemoInstall

spreadsheet-stream

Package Overview
Dependencies
19
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spreadsheet-stream

Semi-streaming XLS(X) / ODS / QPW (and more) parser


Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Install size
13.6 MB
Created
Weekly downloads
 

Readme

Source

spreadsheet-stream

Semi-streaming XLS(X) / ODS / QPW (and more) parser.
"Semi" because these spreadsheet formats are not streamable so the whole thing is buffered in memory. Same as excel-stream but faster because there's no filesystem IO or child process.

npm status node Test Standard

Example

npm i spreadsheet-stream format-data
const sheet = require('spreadsheet-stream')
const format = require('format-data')
const fs = require('fs')

fs.createReadStream('example.xlsx')
  .pipe(sheet())
  .pipe(format('json'))
  .pipe(process.stdout)

NB. Although the underlying parser (xlsx) also supports non-binary formats like CSV, for those formats you're better off with truly streaming solutions like tabular-stream (to support both spreadsheets and CSV), csv-parser or similar. Those are not limited by memory. For a command-line interface, see tabular-cli.

API

sheet([options])

Returns a duplex stream of which the writable side takes a spreadsheet and the readable side yields row objects. Options:

  • maxSize (number, default 0): destroy stream when more than maxSize bytes have been written (i.e. reject big files)
  • sheetIndex (number, default 0): select a sheet
  • sheet (string, default none): select a sheet by its name. Takes precedence over sheetIndex.

Install

With npm do:

npm install spreadsheet-stream

License

MIT © 2019-present Vincent Weevers.

Keywords

FAQs

Last updated on 03 Feb 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc