Socket
Socket
Sign inDemoInstall

xlsx-parse-stream

Package Overview
Dependencies
10
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlsx-parse-stream

Streaming XLSX parser for node


Version published
Maintainers
1
Weekly downloads
520
decreased by-36.74%

Weekly downloads

Readme

Source

xlsx-parse-stream Build Status

Parse excel (XLSX) files as a through stream to JSON using exceljs

Install

$ npm install xlsx-parse-stream

Usage

const excel = require('xlsx-parse-stream')
const request = require('superagent')
const through = require('through2')

// from a URL
const req = request.get('http://localhost:8000/file.xlsx')
  .pipe(excel())
  .pipe(through2.obj((row, _, cb) => {
    // row = the parsed object!
    cb()
  }))


// from the FS
fs.createReadStream(__dirname + '/file.xlsx')
  .pipe(excel())
  .pipe(through2.obj((row, _, cb) => {
    // row = the parsed object!
    cb()
  }))

Options

selector

String or array of strings specifying the sheet names you want to parse. You can also specify "*" to pull from all sheets (this is the default).

When pulling from multiple sheets, the first row of each sheet will be treated as the header.

// loading a specific sheet
fs.createReadStream(__dirname + '/file.xlsx')
  .pipe(excel({ selector: 'Sheet1' }))
  .pipe(through2.obj((row, _, cb) => {
    // row = the parsed object!
    cb()
  }))

  // loading multiple specific sheets
  fs.createReadStream(__dirname + '/file.xlsx')
    .pipe(excel({ selector: [ 'Sheet1', 'Sheet3' ] }))
    .pipe(through2.obj((row, _, cb) => {
      // row = the parsed object!
      cb()
    }))

License (MIT)

Keywords

FAQs

Last updated on 04 Jun 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