UNPKG

motion

Version:

motion - moving development forward

83 lines (82 loc) 7.49 kB
{ "_args": [ [ "pako@https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "pako@>=0.2.0 <0.3.0", "_id": "pako@0.2.8", "_inCache": true, "_location": "/pako", "_phantomChildren": {}, "_requested": { "name": "pako", "raw": "pako@https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "rawSpec": "https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "scope": null, "spec": "https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "type": "remote" }, "_requiredBy": [ "/browserify-zlib" ], "_resolved": "https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "_shasum": "15ad772915362913f20de4a8a164b4aacc6165d6", "_shrinkwrap": null, "_spec": "pako@https://registry.npmjs.org/pako/-/pako-0.2.8.tgz", "_where": "/Users/nw/flint/packages/flint", "bugs": { "url": "https://github.com/nodeca/pako/issues" }, "contributors": [ { "name": "Andrei Tuputcyn", "url": "https://github.com/andr83" }, { "name": "Vitaly Puzrin", "url": "https://github.com/puzrin" } ], "dependencies": {}, "description": "zlib port to javascript - fast, modularized, with browser support", "devDependencies": { "ansi": "*", "async": "*", "benchmark": "*", "browserify": "*", "eslint": "0.17.1", "eslint-plugin-nodeca": "~1.0.3", "grunt": "~0.4.4", "grunt-cli": "~0.1.13", "grunt-contrib-connect": "~0.9.0", "grunt-saucelabs": "~8.6.0", "istanbul": "*", "lodash": "*", "mocha": "1.21.5", "ndoc": "*", "uglify-js": "*" }, "homepage": "https://github.com/nodeca/pako", "keywords": [ "deflate", "gzip", "inflate", "zlib" ], "license": { "type": "MIT", "url": "https://github.com/nodeca/pako/blob/master/LICENSE" }, "main": "./index.js", "name": "pako", "optionalDependencies": {}, "readme": "pako - zlib port to javascript, very fast!\n==========================================\n\n[![Build Status](https://travis-ci.org/nodeca/pako.svg?branch=master)](https://travis-ci.org/nodeca/pako)\n[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako)\n\n__Why pako is cool:__\n\n- Almost as fast in modern JS engines as C implementation (see benchmarks).\n- Works in browsers, you can browserify any separate component.\n- Chunking support for big blobs.\n- Results are binary equal to well known [zlib](http://www.zlib.net/) (now v1.2.8 ported).\n\nThis project was done to understand how fast JS can be and is it necessary to\ndevelop native C modules for CPU-intensive tasks. Enjoy the result!\n\n\n__Famous projects, using pako:__\n\n- [browserify](http://browserify.org/) (via [browserify-zlib](https://github.com/devongovett/browserify-zlib))\n- [JSZip](http://stuk.github.io/jszip/)\n- [mincer](https://github.com/nodeca/mincer)\n- [JS-Git](https://github.com/creationix/js-git) and\n [Tedit](https://chrome.google.com/webstore/detail/tedit-development-environ/ooekdijbnbbjdfjocaiflnjgoohnblgf)\n by [@creatronix](https://github.com/creationix)\n\n\n__Benchmarks:__\n\n```\nnode v0.10.26, 1mb sample:\n\n deflate-dankogai x 4.73 ops/sec ±0.82% (15 runs sampled)\n deflate-gildas x 4.58 ops/sec ±2.33% (15 runs sampled)\n deflate-imaya x 3.22 ops/sec ±3.95% (12 runs sampled)\n ! deflate-pako x 6.99 ops/sec ±0.51% (21 runs sampled)\n deflate-pako-string x 5.89 ops/sec ±0.77% (18 runs sampled)\n deflate-pako-untyped x 4.39 ops/sec ±1.58% (14 runs sampled)\n * deflate-zlib x 14.71 ops/sec ±4.23% (59 runs sampled)\n inflate-dankogai x 32.16 ops/sec ±0.13% (56 runs sampled)\n inflate-imaya x 30.35 ops/sec ±0.92% (53 runs sampled)\n ! inflate-pako x 69.89 ops/sec ±1.46% (71 runs sampled)\n inflate-pako-string x 19.22 ops/sec ±1.86% (49 runs sampled)\n inflate-pako-untyped x 17.19 ops/sec ±0.85% (32 runs sampled)\n * inflate-zlib x 70.03 ops/sec ±1.64% (81 runs sampled)\n\nnode v0.11.12, 1mb sample:\n\n deflate-dankogai x 5.60 ops/sec ±0.49% (17 runs sampled)\n deflate-gildas x 5.06 ops/sec ±6.00% (16 runs sampled)\n deflate-imaya x 3.52 ops/sec ±3.71% (13 runs sampled)\n ! deflate-pako x 11.52 ops/sec ±0.22% (32 runs sampled)\n deflate-pako-string x 9.53 ops/sec ±1.12% (27 runs sampled)\n deflate-pako-untyped x 5.44 ops/sec ±0.72% (17 runs sampled)\n * deflate-zlib x 14.05 ops/sec ±3.34% (63 runs sampled)\n inflate-dankogai x 42.19 ops/sec ±0.09% (56 runs sampled)\n inflate-imaya x 79.68 ops/sec ±1.07% (68 runs sampled)\n ! inflate-pako x 97.52 ops/sec ±0.83% (80 runs sampled)\n inflate-pako-string x 45.19 ops/sec ±1.69% (57 runs sampled)\n inflate-pako-untyped x 24.35 ops/sec ±2.59% (40 runs sampled)\n * inflate-zlib x 60.32 ops/sec ±1.36% (69 runs sampled)\n```\n\nzlib's test is partialy afferted by marshling (that make sense for inflate only).\nYou can change deflate level to 0 in benchmark source, to investigate details.\nFor deflate level 6 results can be considered as correct.\n\n__Install:__\n\nnode.js:\n\n```\nnpm install pako\n```\n\nbrowser:\n\n```\nbower install pako\n```\n\n\nExample & API\n-------------\n\nFull docs - http://nodeca.github.io/pako/\n\n```javascript\nvar pako = require('pako');\n\n// Deflate\n//\nvar input = new Uint8Array();\n//... fill input data here\nvar output = pako.deflate(input);\n\n// Inflate (simple wrapper can throw exception on broken stream)\n//\nvar compressed = new Uint8Array();\n//... fill data to uncompress here\ntry {\n var result = pako.inflate(compressed);\n} catch (err) {\n console.log(err);\n}\n\n//\n// Alternate interface for chunking & without exceptions\n//\n\nvar inflator = new pako.Inflate();\n\ninflator.push(chunk1, false);\ninflator.push(chunk2, false);\n...\ninflator.push(chunkN, true); // true -> last chunk\n\nif (inflator.err) {\n console.log(inflator.msg);\n}\n\nvar output = inflator.result;\n\n```\n\nSometime you can wish to work with strings. For example, to send\nbig objects as json to server. Pako detects input data type. You can\nforce output to be string with option `{ to: 'string' }`.\n\n```javascript\nvar pako = require('pako');\n\nvar test = { my: 'super', puper: [456, 567], awesome: 'pako' };\n\nvar binaryString = pako.deflate(JSON.stringify(test), { to: 'string' });\n\n//\n// Here you can do base64 encode, make xhr requests and so on.\n//\n\nvar restored = JSON.parse(pako.inflate(binaryString, { to: 'string' }));\n```\n\n\nNotes\n-----\n\nPako does not contain some specific zlib functions:\n\n- __deflate__ - methods `deflateCopy`, `deflateBound`, `deflateParams`,\n `deflatePending`, `deflatePrime`, `deflateSetDictionary`, `deflateTune`.\n- __inflate__ - `inflateGetDictionary`, `inflateCopy`, `inflateMark`,\n `inflatePrime`, `inflateSetDictionary`, `inflateSync`, `inflateSyncPoint`,\n `inflateUndermine`.\n\n\nAuthors\n-------\n\n- Andrey Tupitsin [@anrd83](https://github.com/andr83)\n- Vitaly Puzrin [@puzrin](https://github.com/puzrin)\n\nPersonal thanks to:\n\n- Vyacheslav Egorov ([@mraleph](https://github.com/mraleph)) for his awesome\n tutoruals about optimising JS code for v8, [IRHydra](http://mrale.ph/irhydra/)\n tool and his advices.\n- David Duponchel ([@dduponchel](https://github.com/dduponchel)) for help with\n testing.\n\n\nLicense\n-------\n\nMIT\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/nodeca/pako.git" }, "version": "0.2.8" }