xtream

0.1.1 • Public • Published

xtream

NPM

Build Status

stream2 helpers, inspired by rvagg/through2 and its friends

TL;DL

Ttransform stream

  • xtream.through(streamOptions, transform, flush)
  • xtream.map(streamOptions, mapCallback)
  • xtream.reduce(streamOptions, reduceCallback, initial)
  • xtream.filter(streamOptions, filterCallback)

Transform stream helpers that mimick the Array operations.

Passthrough streams

  • xtream.inspect(streamOptions, inspectCallback)

Do nothing but emit every read data to inspectCallback

Duplex streams

  • xtream.duplex(streamOptions, readableStream, writableStream)

Generate a duplex stream that write to writableStream, read from readableStream

Readable streams

  • xtream.split(streamOptions, spliter, mapCallback);

Split emitted data using spliter. Optional mapCallback can be assigned to process each splited result.

Writeable streams

  • xtream.concat(completeCallback)

Collect all readable contents into the completeCallback.

Stream control

  • xtream.combine(fisrtStream, secondStream, thirdStream, ..., lastStream);

Generate a stream pipeline; Write to the first stream, read from last stream and each stream is piped to the next in line.

References

Readme

Keywords

Package Sidebar

Install

npm i xtream

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • robinqu