generator-transform-stream
v1.0.1
Published
Create a transform stream using an async generator
Downloads
3
Maintainers
Readme
generator-transform-stream
Create a transform stream using an async generator
Install
npm i -D generator-transform-stream
Usage
import fs from 'fs';
import { pipeline } from 'stream';
import gts from 'generator-transform-stream';
pipeline(
fs.createReadStream('input.txt', 'utf8'),
gts(async function* transform(input) {
for await (const chunk of input) {
yield chunk.toUpperCase();
}
}),
fs.createWriteStream('output.txt')
);
Development
Run
npm start
Build
npm test
Publish
npm version patch|minor|major
git push --follow-tags