{"name":"brotli","version":"1.3.2","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":"40d0b9d4a2ede5c1b2d240641094e70a47882b0c","_id":"brotli@1.3.2","_shasum":"525a9cad4fcba96475d7d388f6aecb13eed52f46","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"dist":{"shasum":"525a9cad4fcba96475d7d388f6aecb13eed52f46","tarball":"http://registry-npm.ywwl.com/brotli/download/brotli-1.3.2.tgz","integrity":"sha512-K0HNa0RRpUpcF8yS4yNSd6vmkrvA+wRd+symIcwhfqGLAi7YgGlKfO4oDYVgiahiLGNviO9uY7Zlb1MCPeTmSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCslZdNaasOVhNJQe3EKBtLIIClBjm8U3QwxdyhEH1aUgIgI7kDnbelWy1atP7L8f9neuKsL7ESzPkx3fWgLY/FLqE="}],"size":425833,"noattachment":false,"key":"/brotli/-/brotli-1.3.2.tgz"},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/brotli-1.3.2.tgz_1493710188882_0.9105583857744932"},"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":1493710189109,"_cnpm_publish_time":1493710189109,"dist-tags":{"latest":"2.1.0"}}