Skip to content

yetzt/node-chnk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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

About

chunkify a stream of buffers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published