I'm trying to write the output of a compressjs compressFile function to a file.
Right now I just have the default code that he supplies on the page. I am newer to node and I guess I really don't know where to start. Basically I want to take 'compressed' and write it to 'file.bz2'
var compressjs = require('compressjs');
var algorithm = compressjs.Bzip2;
var data = new Buffer('Example data', 'utf8');
var compressed = algorithm.compressFile(data);
It seems the compressFile function can take a "stream"-like object as second parameter, but it is not working with a fs.createWriteStream object (because it does not implement the required writeByte function).
You could take a look at how the executable of the package creates the output file: