Note code taken from Shin Suzuki's bgzf package. All credit to him.
BGZF
inflates BGZF written in C++
installation
$ npm install bgzf
usage
var bgzf = ;var bam = ;var result = bgzf;var inflated = result0; // inflated buffervar d_offsets = result1; // offsets of each BGZFvar i_offsets = result2; // offsets of each BGZF in the inflated buffervar remainder = result3; // unparsed buffer (rightmost side of the given buffer)