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
npm
npm install xlsx-write-stream-transform
Yarn
yarn add xlsx-write-stream-transform
ES Modules / ES6 / Typescript
import {XLSXTransform} from 'xlsx-write-stream-transform'
Package provides TypeScript types
UMD
const {XLSXTransform} = require('xlsx-write-stream-transform')
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
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.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.