{"name":"bzip2","version":"0.1.1","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","gitHead":"decfb7b8c8bc369ec2acf2e5d0eb884df3be0a1e","bugs":{"url":"https://github.com/jvrousseau/bzip2.js/issues"},"_id":"bzip2@0.1.1","scripts":{},"_shasum":"b0d232bd0f0f750d2023306d40a886ee51b901f4","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jvrousseau","email":"jv.rousseau@outlook.com"},"maintainers":[{"name":"jvrousseau","email":"jv.rousseau@outlook.com"}],"dist":{"shasum":"b0d232bd0f0f750d2023306d40a886ee51b901f4","tarball":"http://registry-npm.ywwl.com/bzip2/download/bzip2-0.1.1.tgz","integrity":"sha512-wMvOIQ5jX3ikcCxWO1HjYVOAB+sjKzMTYLQmFPi4d6GBF01cYpnIwQ4RaDX4F3QSJeiB6gFqt5hh9fbebCSspw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbitjF/c8DAkn1ZXxIdelSruQTmidMiiS5eXEcc696dAiEApGI6jJNsmszd2dQLw6Iz/8tH3aI0AcTwdjVrlbgzrcc="}],"size":5282,"noattachment":false,"key":"/bzip2/-/bzip2-0.1.1.tgz"},"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":1417624991852,"_cnpm_publish_time":1417624991852,"dist-tags":{"latest":"0.1.1"}}