stream-array-buffer
v1.0.1
Published
`stream-array-buffer` is a `stream.Transform` of Node.js. It gathers input values and emits them as an array.
Downloads
4
Readme
stream-array-buffer
stream-array-buffer
is a stream.Transform
of Node.js.
It gathers input values and emits them as an array.
const streamBuffer = require('stream-array-buffer')({size: 3});
toStream(['a', 'b', 'c', 'd', 'e', 'f', 'g'])
.pipe(streamBuffer) // objectMode is true.
.pipe(toJsonString) // so, convert the array to string for the next task.
.pipe(process.stdout);
// => ["a","b","c"]["d","e","f"]["g"]
Usage
$ npm install --save stream-array-buffer
// `size` option is the length of array.
const streamBuffer = require('stream-array-buffer')({size: 3});