2.0.0 • Published 9 months ago

xlsxtream v2.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 months ago

workflow Jest coverage

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

Only common workbook data (including the shared strings list) are kept in memory; worksheets contents is read row by row using a chain of transform streams.

Basically, rows read are Arrays of Strings. Dates are presented in YYYY-MM-DD format, time in HH:MI:SS. No effort is made to properly map scalar values to javaScript objects as the module is presumed to transform .xlsx data into CSV and other text formats for further bulk load into databases and similar operations.

Advanced users may prefer to alter the output format by accessing some lower level internals (see the reference below).

Installation

npm install xlsxtream

Usage

const xlsx = require ('xlsxtream')

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

const worksheet = workbook.sheetByName.Sheet1
// const worksheet = workbook.sheets [0]
// worksheet.toObject = function (xmlNode) {return ...}

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

See the project's wiki docs for more information.

2.0.0

9 months ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago