stream-array-buffer

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i stream-array-buffer

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • grohiro