JSPM

  • Created
  • Published
  • Downloads 12203
  • Score
    100M100P100Q144813F
  • License Apache-2.0

Apify xlsx write stream helper

Package Exports

  • xlsx-write-stream

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xlsx-write-stream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

XLSX Write Stream

XLSX Write Stream is a streaming writer for XLSX spreadsheets. Its purpose is to replace CSV for large exports, because using CSV in Excel is very buggy and error prone. It's very efficient and can quickly write hundreds of thousands of rows with low memory usage.

XLSX Write Stream does not support formatting, charts, comments and a myriad of other OOXML features. It's strictly an CSV replacement.

Installation

npm i 'xlsx-write-stream'

Example Usage

import XLSXWriteStream from 'xlsx-write-stream';


// Initialize the writer
const xlsxWriter = new XLSXWriteStream();

// Set input stream. Input stream needs to implement Stream.Readable interface
// and each chunk should be an array of values (only string, date and number are supported value types)
xlsxWriter.setInputStream(inputStream);

// Get output stream. This will return a stream of XLSX file data.
const xlsxStream = xlsxWriter.getOutputStream();

// do something with the output, like write it into file or send it as HTTP response
const writeStream = fs.createWriteStream('file.xlsx');
xlsxStream.pipe(writeStream);

License

This package is available as open source under the terms of the MIT License.