https://github.com/grohiro/stream-array-buffer
stream-array-buffer gathers input values and emits them as an array.
https://github.com/grohiro/stream-array-buffer
Last synced: 7 months ago
JSON representation
stream-array-buffer gathers input values and emits them as an array.
- Host: GitHub
- URL: https://github.com/grohiro/stream-array-buffer
- Owner: grohiro
- License: mit
- Created: 2017-06-11T18:34:54.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-11T19:23:11.000Z (almost 9 years ago)
- Last Synced: 2025-02-24T01:48:25.896Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stream-array-buffer
`stream-array-buffer` is a `stream.Transform` of Node.js.
It gathers input values and emits them as an array.
```javascript
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
```console
$ npm install --save stream-array-buffer
```
```javascript
// `size` option is the length of array.
const streamBuffer = require('stream-array-buffer')({size: 3});
```