Skip to content

ikeisuke/node-easy-concurrent-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
  }
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published