Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 574 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 574 Bytes

stream-arrays

ReadableArray

Convert an Array to a stream-objectmode.Readable.

var things = new (require('stream-arrays').ReadableArray)([1,2,3,4,5]);
things.on('data', console.log);
// 1
// 2
// 3
// 4
// 5

WritableArray

Convert an Array to a stream-objectmode.Writable.

var things = new (require('stream-arrays').ReadableArray)([1,2,3,4,5]);
var dest = new (require('stream-arrays').WritableArray)();
things.pipe(dest);

dest.on('finish', function () {
    dest.get().map(console.log);
});
// 1
// 2
// 3
// 4
// 5