{"name":"brotli","version":"1.0.2","description":"A port of the Brotli compression algorithm as used in WOFF2","main":"index.js","repository":{"type":"git","url":"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","gitHead":"1c176aee7f2222e9023cccfc5545bd4deef9e0e5","_id":"brotli@1.0.2","scripts":{},"_shasum":"548fcb29d1145e01c016931e07dc8f1505dcca86","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"dist":{"shasum":"548fcb29d1145e01c016931e07dc8f1505dcca86","tarball":"http://registry-npm.ywwl.com/brotli/download/brotli-1.0.2.tgz","integrity":"sha512-QYozeJ5iEhcM0F+Vdd0MivPxXZQc+u5O9yDjmsExEsrU377I2VhbPW0Iii5zCwGeRi04w2RO0UZVGKgBAw7VdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEW6SqxESAm6pLmGsVAf4BIihpF3vr0djMzZqn+99udiAiBIpaUh8iMKb1X0DGEeIuXMv5sa7zxxuRJAFXzSXKSobA=="}],"size":464637,"noattachment":false,"key":"/brotli/-/brotli-1.0.2.tgz"},"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":1423343129134,"_cnpm_publish_time":1423343129134,"dist-tags":{"latest":"2.1.0"}}