1.1.0 • Published 3 years ago

xlsx-write-stream-transform v1.1.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
3 years ago

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.

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago