https://github.com/keybase/node-chunk-stream
base class for chunked node streams
https://github.com/keybase/node-chunk-stream
Last synced: 4 months ago
JSON representation
base class for chunked node streams
- Host: GitHub
- URL: https://github.com/keybase/node-chunk-stream
- Owner: keybase
- License: bsd-3-clause
- Created: 2016-07-05T18:52:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-16T15:02:01.000Z (over 8 years ago)
- Last Synced: 2024-12-22T09:03:35.872Z (4 months ago)
- Language: JavaScript
- Size: 233 KB
- Stars: 2
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-chunk-stream
A TransformStream implementation for applications where exact or exact-multiple chunk sizes are needed.
## Install
npm install keybase-chunk-stream
## Use cases
This tool was created for situations where you, as a stream consumer, need to modify data on a chunk-by-chunk basis, e.g. BaseX armoring or cryptography.
## API
This tool exposes a simple TransformStream implementation with some sugar. To create a ChunkStream that simply passes through data without modification in chunks of even length:
cstream = require('keybase-chunk-stream')
transform_func = (x, cb) -> cb(null, x)
cs = new cstream.ChunkStream({transform_func, block_size : 2})