JSPM

chnk

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q33202F
  • License Unlicense

split a binary data stream of buffers into equal size chunks

Package Exports

  • chnk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chnk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

chnk

Split a binary data stream into equal size chunks

Install

npm install chnk

Usage

chnk(<size>) - returns a transform stream that reads from a stream of variable length buffers and writes a stream of fixed length chunks of size bytes;

Example

var chnk = require("chnk");

process.stdin.pipe(chnk(32)).on("data", function(buf){
    console.log("received: "+buf.toString("hex"));
}).on("error", function(err, buf){
    console.log(err.toString(), buf.toString("hex"));
}).on("end", function(){
    console.log("done.");
});

License

Unlicense