Socket
Socket
Sign inDemoInstall

simple-xlsx-reader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-xlsx-reader

A utility to read xlsx files through NodeJS Stream.


Version published
Weekly downloads
17
decreased by-55.26%
Maintainers
1
Weekly downloads
 
Created
Source

simple-xlsx-reader

A utility to read xlsx files through NodeJS Stream.

Build Status

Instalation

npm i simple-xlsx-reader --save

Usage

const { Writable } = require('stream')
const fs = require('fs')
const { xlsxParser } = require('simple-xlsx-reader')

const write = (fn) => {
  return new Writable({
    objectMode: true,
    write (chunk, _, callback) {
      fn(chunk)
      callback()
    }
  })
}

fs.createReadStream('path to xlsx file'))
  .pipe(xlsxParser())
  .pipe(write((row) => {
    console.log('XLSX Row', row)
  }))

To return in array of arrays format, you can use onlyCellValues function that get only values of cells.

const { Writable } = require('stream')
const fs = require('fs')
const { xlsxParser, onlyCellValues } = require('simple-xlsx-reader')

const write = (fn) => {
  return new Writable({
    objectMode: true,
    write (chunk, _, callback) {
      fn(chunk)
      callback()
    }
  })
}

fs.createReadStream('path to xlsx file'))
  .pipe(xlsxParser(onlyCellValues()))
  .pipe(write((row) => {
    console.log('XLSX Row', row)
  }))

Keywords

FAQs

Package last updated on 22 Jun 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc