Skip to content

grohiro/stream-array-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

stream-array-buffer gathers input values and emits them as an array.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors