2.0.3 • Published 4 years ago

metapipe v2.0.3

Weekly downloads
389
License
LGPL-3.0
Repository
gitlab
Last release
4 years ago

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

2.0.3

4 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago