{"name":"lz4js","version":"0.1.2","description":"An Lz4 implementation for the browser.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@github.com/Benzinga/lz4js.git"},"keywords":["lz4","compression","decompression","browser","commonjs"],"author":{"name":"John Chadwick"},"license":"ISC","bugs":{"url":"https://github.com/Benzinga/lz4js/issues"},"homepage":"https://github.com/Benzinga/lz4js#readme","gitHead":"540d8f9a6256889ac695c11a0e54d0780ad660fb","_id":"lz4js@0.1.2","_shasum":"5267b808dfa2e00f7d476ea49592876a0b9e160c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.2.2","_npmUser":{"name":"johnwchadwick","email":"johnwchadwick@gmail.com"},"dist":{"shasum":"5267b808dfa2e00f7d476ea49592876a0b9e160c","tarball":"http://registry-npm.ywwl.com/lz4js/download/lz4js-0.1.2.tgz","integrity":"sha512-gOQ5Da34VIE/CtRZO4iNRqQRCC01l+xpS29esekcdPod65MMz6pZQumSecdrbs33bvEz/d9/d7engQu/v4N47A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5cxvmdyWvrVovyF/J60Ymot7GetusNL2lC/RhyDxpqAiEA2qG9Zu7NApxUHi9OeXRl4+u/rhGyNPEzIza6wJiq9Sk="}],"size":5960,"noattachment":false,"key":"/lz4js/-/lz4js-0.1.2.tgz"},"maintainers":[{"name":"johnwchadwick","email":"johnwchadwick@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/lz4js-0.1.2.tgz_1467919989296_0.8480985499918461"},"directories":{},"readme":"# Lz4.js [![NPM version](https://badge.fury.io/js/lz4js.svg)](https://www.npmjs.com/package/lz4js) [![Build Status](https://travis-ci.org/Benzinga/lz4js.svg?branch=master)](https://travis-ci.org/Benzinga/lz4js) [![codecov](https://codecov.io/gh/Benzinga/lz4js/branch/master/graph/badge.svg)](https://codecov.io/gh/Benzinga/lz4js)\nLz4.js is an implementation of Lz4 designed to be used in web browsers. It contains no dependencies on external libraries or Node.JS, though it is organized as a set of CommonJS modules. It is recommended to use Browserify or WebPack to bundle this for the web browser.\n\n## Installation\n```\nnpm install lz4js\n```\n\n## Usage\n```javascript\nvar lz4 = require(\"lz4js\");\nvar fs = require(\"fs\");\n\n// Compress 128 bytes of zero.\nvar compressed = lz4.compress(new Array(128));\n\n// Decompress.\nvar decompressed = lz4.decompress(compressed);\n\n// Compress file.bin to file.lz4.\nvar data = fs.readFileSync(\"file.bin\");\ncompressed = Buffer.from(lz4.compress(data));\nfs.writeFileSync('file.lz4', compressed);\n```\n\n> **Note**: The high-level `compress` and `decompress` functions deal with framed Lz4 data and do not support raw block data nor legacy Lz4 blocks.\n\n## API\nThe API accepts either `Array`s or `Uint8Array`s. Arrays are expected to be arrays of unsigned 8-bit values. The API will return `Uint8Array`s if the browser supports them, or `Array`s otherwise.\n\n  - `compress(buffer: Array, maxSize: Number): Array`\n\n    Compresses a buffer using Lz4. maxSize sets bounds on the output length; it is recommended to not specify this unless you know what you're doing.\n    Any unused buffer data will be sliced before the buffer is returned.\n\n  - `decompress(buffer: Array, maxSize: Number): Array`\n\n    Decompresses a buffer using Lz4. maxSize sets bounds on the output length; if you know the output length, this will reduce memory usage somewhat.\n    Any unused buffer data will be sliced before the buffer is returned.\n","publish_time":1467919991678,"_cnpm_publish_time":1467919991678,"dist-tags":{"latest":"0.2.0"}}