fss

fixed-size-stream-splitter

split a stream into many fixed-size streams

Showing:

Popularity

Downloads/wk

23

GitHub Stars

16

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

2

Size (min+gzip)

8.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

fixed-size-stream-splitter

split a stream into many fixed-size streams

Unlike similar modules such as block-stream, this package does not buffer each fixed-size chunk into memory.

fixed-size-stream-splitter may be more appropriate for very large chunks that may not fit easily into memory.

example

var splitter = require('fixed-size-stream-splitter')
var concat = require('concat-stream')

process.stdin.pipe(splitter(5, function (stream) {
  stream.pipe(concat(function (body) {
    console.log(body.toString())
  }))
}))

output

$ echo -n abcdefghijklmnop | node split.js
abcde
fghij
klmno
p

api

var splitter = require('fixed-size-stream-splitter')

var wstream = splitter(size, cb)

var wstream = splitter(opts, cb)

Return a writable stream wstream that will split its input into streams of opts.size bytes. Each stream is available in cb(stream).

Use opts.offset to emit a first chunk that is smaller than opts.size by opts.offset % opts.size bytes.

install

npm install fixed-size-stream-splitter

license

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100