easy-concurrent-stream

0.1.2 • Public • Published

EasyConcurrentStream

build status npm version Code Climate MIT License

Create concurrent transform stream from an asyncronous function.

How to use

Interface compatible with buildin stream.Transform https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream

const Transform = require('easy-concurrent-stream').Transform;
 
const transform = new Transform({
  transform: function(chunk, encoding, callback) {
    async_function(chunk, function(data){
      callback(null, data);
    });
  },
  flush: function(callback) {
    // optionally
    // when remaining data has been flushed.
    callback();
  }
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    15
  • 0.1.1
    0
  • 0.1.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i easy-concurrent-stream

Weekly Downloads

15

Version

0.1.2

License

MIT

Unpacked Size

40.3 kB

Total Files

9

Last publish

Collaborators

  • ikeisuke