npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

xlsxtream

v2.0.5

Published

Reading .xlsx worksheets as object streams

Downloads

1,601

Readme

workflow Jest coverage

xlsxtream is a module for reading tabulated data from .xlsx (and, in general, OOXML) workbooks using node.js streams API.

Installation

npm install xlsxtream

Usage

const xlsx = require ('xlsxtream')

const wb = await xlsx.open ('/path/to/book.xlsx')

const ws = wb.sheetByName.Sheet1
// const ws = workbook.sheets [0] // WARNING: physical order

// just measuring 
const lastRow = await ws.getLastRow ()
if (lastRow.index > 10000) throw Error ('Size limit exceeded')

// extracting text, easy
const stringArrays = await ws.getObjectStream ()
for await (const [A, B, C] of stringArrays) {
  console.log (`A=${A}, B=${B}, C=${C}`)
  console.log (` (read ${worksheet.position} of ${worksheet.size} bytes)`)
}

// advanced processing
const rows = await ws.getRowStream ()
for await (const row of rows) {
  console.log (`Logical #${row.index}, physical #${row.num}`)
  for (const cell of cells) {
    if (cell === null) {
      // empty cell, missing from XML
    }
    else {
      // process cell.index, cell.valueOf () etc.
    }
  }
}

Rationale

Though exceljs is the standard de facto for working with .xlsx files in the node.js ecosystem, it appears to be a bit too resource greedy in some applications. Specifically, when it takes to perform a simple data extraction (like converting to CSV) from a huge workbook (i. e. millions of rows).

The original exceljs API is synchronous and presumes the complete data tree to be loaded in memory, which is totally inappropriate for such tasks. Since some point in time, the Streaming I/O is implemented, but, as of writing this line, it still operates on a vast amount of data that may not be used at all.

The present module, xlsxtream takes the opposite approach: it uses the streams API from the ground up, focuses on keeping the memory footprint as little as possible and letting the developer avoid every single operation not required by the task to perform. To this end, xlsxtream: