{"name":"brotli","version":"1.3.1","description":"A port of the Brotli compression algorithm as used in WOFF2","main":"index.js","repository":{"type":"git","url":"git+https://github.com/devongovett/brotli.js.git"},"keywords":["compress","decompress","encode","decode"],"author":{"name":"Devon Govett","email":"devongovett@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/devongovett/brotli.js/issues"},"homepage":"https://github.com/devongovett/brotli.js","dependencies":{"base64-js":"^1.1.2"},"devDependencies":{"mocha":"^2.2.1"},"browser":{"./dec/dictionary-data.js":"./dec/dictionary-browser.js"},"scripts":{"test":"mocha","prepublish":"make"},"gitHead":"da44b7ac2aaf9884ac6fdd8dff37970b8704c6bf","_id":"brotli@1.3.1","_shasum":"352a6f3f6973c5a74fd4be04aba40b337b3b6a7e","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"dist":{"shasum":"352a6f3f6973c5a74fd4be04aba40b337b3b6a7e","tarball":"http://registry-npm.ywwl.com/brotli/download/brotli-1.3.1.tgz","integrity":"sha512-WdNdPkL8w9Fs1bqOMdR8HCyXLpdYa6r5lYIY0RqEm2iKNTKYFoVFexl3E7QnheDvKL6YJuc31eiAjppRu1OAtQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHPXjpNfdaMgb6xZFZ44CYUzaFc3BxeuQs9ahuUfL3oAiAY7OOLiYInuYNZRCuAfvRKdKmBlbTpAsko3/V4+hxGJw=="}],"size":425839,"noattachment":false,"key":"/brotli/-/brotli-1.3.1.tgz"},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/brotli-1.3.1.tgz_1473824079123_0.6083398039918393"},"directories":{},"readme":"# Brotli.js\n\nBrotli.js is port of the [Brotli](http://tools.ietf.org/html/draft-alakuijala-brotli-01) compression algorithm (as used in the [WOFF2](http://www.w3.org/TR/WOFF2/) font format) to JavaScript. The decompressor is hand ported, and the compressor is ported\nwith Emscripten.  The original C++ source code can be found [here](http://github.com/google/brotli).\n\n## Installation and usage\n\nInstall using npm.\n\n    npm install brotli\n\nIf you want to use brotli in the browser, you should use [Browserify](http://browserify.org/) to build it.\n\nIn node, or in browserify, you can load brotli in the standard way:\n\n```javascript\nvar brotli = require('brotli');\n```\n\nYou can also require just the `decompress` function or just the `compress` function, which is useful for browserify builds.\nFor example, here's how you'd require just the `decompress` function.\n\n```javascript\nvar decompress = require('brotli/decompress');\n```\n\n## API\n\n### brotli.decompress(buffer, [outSize])\n\nDecompresses the given buffer to produce the original input to the compressor.\nThe `outSize` parameter is optional, and will be computed by the decompressor\nif not provided. Inside a WOFF2 file, this can be computed from the WOFF2 directory.\n\n```javascript\n// decode a buffer where the output size is known\nbrotli.decompress(compressedData, uncompressedLength);\n\n// decode a buffer where the output size is not known\nbrotli.decompress(fs.readFileSync('compressed.bin'));\n```\n\n### brotli.compress(buffer, isText = false)\n\nCompresses the given buffer. Pass optional parameters as the second argument.\n\n```javascript\n// encode a buffer of binary data\nbrotli.compress(fs.readFileSync('myfile.bin'));\n\n// encode some data with options (default options shown)\nbrotli.compress(fs.readFileSync('myfile.bin'), {\n  mode: 0, // 0 = generic, 1 = text, 2 = font (WOFF2)\n  quality: 11, // 0 - 11\n  lgwin: 22 // window size\n});\n```\n\n## License\n\nMIT\n","publish_time":1473824079357,"_cnpm_publish_time":1473824079357,"dist-tags":{"latest":"2.1.0"}}