{"name":"brotli","version":"1.2.0","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":{"brfs":"^1.4.0","pako":"^0.2.6","through":"^2.3.6"},"devDependencies":{"mocha":"^2.2.1"},"browser":{"./dec/dictionary-data.js":"./dec/dictionary-browser.js"},"browserify":{"transform":["./src/transform"]},"scripts":{"test":"mocha"},"gitHead":"e974146a5a38c8ff00f7866a05a238a6a334012d","_id":"brotli@1.2.0","_shasum":"b716947531fa780067886cda45fd770e8587edf0","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"dist":{"shasum":"b716947531fa780067886cda45fd770e8587edf0","tarball":"http://registry-npm.ywwl.com/brotli/download/brotli-1.2.0.tgz","integrity":"sha512-JF5r43J+nRYcqI38Za3Px6OT2kLoQpaSr02Xjx09ng3wjRtN4nrBmj/Yaa06TmmHQR63ceS1NnBG5Wbt2P37iQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcp+n6eZZJJ6cjSFf7mZgFuMx7b/Ql1xuMUkaaJU10EAiBfTNaGVPvgpYBeOEpOEWDN7A6F0WXES8EIvn97gTbsJA=="}],"size":516504,"noattachment":false,"key":"/brotli/-/brotli-1.2.0.tgz"},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/brotli-1.2.0.tgz_1459120847283_0.8294150321744382"},"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":1459120848276,"_cnpm_publish_time":1459120848276,"dist-tags":{"latest":"2.1.0"}}