{"name":"bzip2","version":"0.1.0","description":"A npm package of a bunzip implementation in pure javascript","author":{"name":"Jordan Rousseau","email":"jv.rousseau@outlook.com"},"homepage":"https://github.com/jvrousseau/bzip2.js","repository":{"url":"git@github.com:jvrousseau/bzip2.js.git","type":"git"},"main":"bzip2","bugs":{"url":"https://github.com/jvrousseau/bzip2.js/issues"},"_id":"bzip2@0.1.0","dist":{"shasum":"f4bec09fa7a6e51e80c9d8e623e8f45140cb52ab","tarball":"http://registry-npm.ywwl.com/bzip2/download/bzip2-0.1.0.tgz","integrity":"sha512-3/nsg1OEsZyBMkPsyAoWG9imKTh2GwR787Wk2vyRoIkbsxMkaeIULJLkuqi+r22fGqY8DeCZiproT1qyXx6zQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8miUFU4K2XEj5pxuCVp010CGzr/2FG1nkpXP8NITLSAiEAhSkkifTv4VhUTO2CgO9OGoUUb6ZdEc1eFwGz6Cwo0zg="}],"size":5403,"noattachment":false,"key":"/bzip2/-/bzip2-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"jvrousseau","email":"jv.rousseau@outlook.com"},"maintainers":[{"name":"jvrousseau","email":"jv.rousseau@outlook.com"}],"directories":{},"readme":"So, I guess this would be the readme file for my bzip2 implementation.\n\nIt's actually pretty simple to use, you can pass your `Uint8Array` to the `bzip2.array` method to get a bit reader function. This bit reader function is what all the other methods, `header`, `decompress`, and `simple` use. \n\n`header(bitstream)` quite obviously reads in the bzip2 file header. It returns a single number between 1 and 9 describing the block size, which is one of the arguments of `decompress`\n\n`decompress(bitstream, size[, len])` does the main decompression of a single block. It'll return -1 if it detects that it's the final block, otherwise it returns a string with the decompressed data. If you want to cap the output to a certain number of bytes, set the `len` argument.\n\n`simple(bitstream)` is what you probably want to use, because it combines `header` and loops over `decompress` so that the entire file is decompressed and returned as a string.\n\n`array(typed_array)` is the function that generates that mythical bitstream function from a standard `Uint8Array` which you can make from an array buffer with `new Uint8Array(arraybuffer)`.\n","publish_time":1392270807369,"_cnpm_publish_time":1392270807369,"dist-tags":{"latest":"0.1.1"}}