npm.io
0.6.0 • Published 11 years ago

promising-streams

Licence
MIT
Version
0.6.0
Deps
5
Vulns
0
Weekly
0
Stars
1

Promising-Streams

Create Streams which utilise promises for their internal methods.

Usage

Readable([options,] read)

Readable can be called as a method or instantiated, either way it returns a new instance of a ReadablePromiseStream.

Examples
var readable = require('promising-streams').Readable

var arr = ['a', 'b', 'c', 'd', 'e'];

readable(() => Promise.resolve(arr.shift() || null))
.pipe(someOtherStream);

This basically sets the streams internal _read method to call the supplied read callback. The only difference to regular streams is that the callback is set to __read rather than _read

Keywords