xlsx-write-stream-transform
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

XLSX Excel Write Stream Transformer

High perfomance streaming Excel XLSX creation as a replacement for existing CSV exports. There are no options to format or style the output.

This library is no replacement for exceljs.

This project is based on the existing library xlsx-write-stream

Installation

npm

npm install xlsx-write-stream-transform

Yarn

yarn add xlsx-write-stream-transform

Usage

ES Modules / ES6 / Typescript

import {XLSXTransform} from 'xlsx-write-stream-transform'

Package provides TypeScript types

UMD

const {XLSXTransform} = require('xlsx-write-stream-transform')

Example

index.mjs (Node.js >= 14.8)

import { XLSXTransform } from 'xlsx-write-stream-transform'
import { Readable } from 'stream';
import { pipeline } from 'stream/promises'
import * as fs from 'fs'

const inputStream = new Readable({ objectMode: true })
const transform = new XLSXTransform();
const outputStream = fs.createWriteStream('test.xlsx');

const p = pipeline(
    inputStream,
    transform,
    outputStream
)

const nowDate=new Date();
inputStream.push(['Index', 'Text', 'Number', 'Boolean', 'Date'])
for (let index = 1; index <= 1000; index++) {
    inputStream.push([index, 'Text', 99.99, true, nowDate])
}
inputStream.push(null)

await p

Contribution

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Built With

License

Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.

/xlsx-write-stream-transform/

    Package Sidebar

    Install

    npm i xlsx-write-stream-transform

    Weekly Downloads

    790

    Version

    1.1.0

    License

    BSD-2-Clause

    Unpacked Size

    32.4 kB

    Total Files

    24

    Last publish

    Collaborators

    • aheissenberger