metapipe

a transform stream composed of transform streams

MetaPipe

Transform stream composed of transform streams! And how!

Install

Install using Node Package Manager.

npm install metapipe --save

Usage

Create a pipeline, which is just a transform stream. Add additional tranform streams at any time!

const MetaPipe = require('metapipe');
const pipeline = new MetaPipe({ objectMode: true });

// Default is a simple passthrough
pipeline.write({ foo: 'bar' });
pipeline.read(); // { foo: 'bar' }

// Add a transform to the end of the pipeline (can also `prepend`)
pipeline.append(new stream.Transform({
  transform: (data, enc, callback) => {
    data.bar = 'baz';
    callback(null, data);
  },
  objectMode: true
}));
pipeline.write({ foo: 'bar' });
pipeline.read(); // { foo: 'bar', bar: 'baz' }

License

GNU LESSER GENERAL PUBLIC LICENSE 3.0

HomePage

https://gitlab.com/emrose/metapipe#readme

Repository

https+https://gitlab.com/emrose/metapipe


上一篇:CSS选择器及三大特性 (2)
下一篇:elliptic-es

相关推荐

暂无相关文章

官方社区

扫码加入 JavaScript 社区