{"_id":"lzma-purejs-requirejs","name":"lzma-purejs-requirejs","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"lzma-purejs-requirejs","version":"1.0.0","author":{"name":"Gary Linscott, Juan Mellado, C. Scott Ananian"},"description":"pure JavaScript LZMA de/compression, for node.js, volo, and the browser.","keywords":["lzma","compression","decompression"],"main":"main","repository":{"url":"git+https://github.com/Leo4815162342/lzma-purejs.git"},"license":"BSD","bin":{"lzmajs":"bin/lzmajs"},"directories":{"test":"test"},"dependencies":{"amdefine":"~0.1.0","commander":"~2.2.0"},"devDependencies":{"mocha":"~1.18.0","fibers":"~1.0.1"},"scripts":{"test":"mocha"},"amd":{},"volo":{},"gitHead":"97efab11c0c0c4f8d1081ce748c3aa23f3d68be3","bugs":{"url":"https://github.com/Leo4815162342/lzma-purejs/issues"},"homepage":"https://github.com/Leo4815162342/lzma-purejs#readme","_id":"lzma-purejs-requirejs@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-nQgC+oDmBKPdWoC//X51scWTN5D3zdIL7oN+plbKjhZ+u5LAZsF0/yIiYTNtj+TjB1o6mp9R4Ey5DW6elBEu8w==","shasum":"681b3ab1d82143492361618312f59511beec04b1","tarball":"https://registry.npmjs.org/lzma-purejs-requirejs/-/lzma-purejs-requirejs-1.0.0.tgz","fileCount":39,"unpackedSize":1803938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEWFaYPwWkocDywq4ks9HK/N31swndD3BkFibe6mfCFAIgLIllG2T7cs176bu5kAuHE4KuF3VUlS/1OZTvtO57aII="}]},"_npmUser":{"name":"leonid.pyrlia","email":"leonid.pyrlya@gmail.com"},"maintainers":[{"name":"leonid.pyrlia","email":"leonid.pyrlya@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lzma-purejs-requirejs_1.0.0_1690028030952_0.8001797585982469"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-22T12:13:50.952Z","1.0.0":"2023-07-22T12:13:51.330Z","modified":"2023-07-22T12:13:51.622Z"},"maintainers":[{"name":"leonid.pyrlia","email":"leonid.pyrlya@gmail.com"}],"description":"pure JavaScript LZMA de/compression, for node.js, volo, and the browser.","homepage":"https://github.com/Leo4815162342/lzma-purejs#readme","keywords":["lzma","compression","decompression"],"repository":{"url":"git+https://github.com/Leo4815162342/lzma-purejs.git"},"author":{"name":"Gary Linscott, Juan Mellado, C. Scott Ananian"},"bugs":{"url":"https://github.com/Leo4815162342/lzma-purejs/issues"},"license":"BSD","readme":"⚠️ THIS A FORK OF https://github.com/cscott/lzma-purejs rewritten in RequireJS ⚠️\n\n# lzmajs\n\n[![Build Status][1]][2] [![dependency status][3]][4] [![dev dependency status][5]][6]\n\n`lzmajs` is a fast pure-JavaScript implementation of LZMA\ncompression/decompression.  It was originally written by Gary Linscott\nbased on decompression code by Juan Mellado and the 7-Zip SDK.\nC. Scott Ananian started by cleaning up the source code and packaging\nit for `node` and `volo`, then moved on to more extensive refactoring\nand validation against the upstream Java implementation, adding\ntest cases, etc.\n\n## How to install\n\n```\nnpm install lzma-purejs\n```\nor\n```\nvolo add cscott/lzma-purejs\n```\n\nThis package uses\n[Typed Arrays](https://developer.mozilla.org/en-US/docs/JavaScript/Typed_arrays)\nand so requires node.js >= 0.5.5.  Full browser compatibility table\nis available at [caniuse.com](http://caniuse.com/typedarrays); briefly:\nIE 10, Firefox 4, Chrome 7, or Safari 5.1.\n\n## Testing\n\n```\nnpm install\nnpm test\n```\n\n## Usage\n\nThere is a binary available in bin:\n```\n$ bin/lzmajs --help\n$ echo \"Test me\" | bin/lzmajs -z > test.lzma\n$ bin/lzmajs -d test.lzma\nTest me\n```\n\nFrom JavaScript:\n```\nvar lzmajs = require('lzma-purejs');\nvar data = new Buffer('Example data', 'utf8');\nvar compressed = lzmajs.compressFile(data);\nvar decompressed = lzmajs.decompressFile(compressed);\n// convert from array back to string\nvar data2 = new Buffer(decompressed).toString('utf8');\nconsole.log(data2);\n```\nThere is a streaming interface as well.\n\nSee the tests in the `tests/` directory for further usage examples.\n\n## Documentation\n\n`require('lzma-purejs')` returns a `lzmajs` object.  It contains two main\nmethods.  The first is a function accepting one, two, three or four\nparameters:\n\n`lzmajs.compressFile = function(input, [output], [Number compressionLevel] or [props], [progress])`\n\nThe `input` argument can be a \"stream\" object (which must implement the\n`readByte` method), or a `Uint8Array`, `Buffer`, or array.\n\nIf you omit the second argument, `compressFile` will return a JavaScript\narray containing the byte values of the compressed data.  If you pass\na second argument, it must be a \"stream\" object (which must implement the\n`writeByte` method).\n\nThe third argument may be omitted, or a number between 1 and 9 indicating\na compression level (1 being largest/fastest compression and 9 being\nsmallest/slowest compression), or else an object with fields specifying\nspecific lzma encoder parameters; see `lib/Util.js` for details.\n\nThe fourth argument, if present, is a callback which will be invoked\nmultiple times as `progress(inSize, outSize)`, where inSize is the number of\ninput stream bytes which have currently been processed, and outSize is the\ncorresponding number of output bytes which have been generated.\n\nThe second exported method is a function accepting one or two parameters:\n\n`lzmajs.decompressFile = function(input, [output])`\n\nThe `input` parameter is as above.\n\nIf you omit the second argument, `decompressFile` will return a\n`Uint8Array`, `Buffer` or JavaScript array with the decompressed\ndata, depending on what your platform supports.  For most modern\nplatforms (modern browsers, recent node.js releases) the returned\nvalue will be a `Uint8Array`.\n\nIf you provide the second argument, it must be a \"stream\", implementing\nthe `writeByte` method.\n\n## Asynchronous streaming\n\nSee the `test/stream.js` for sample code using the `fibers` package\nto implement an asynchronous de/compression interface.\n\n## Related projects\n\n* http://code.google.com/p/js-lzma Decompression code by Juan Mellado\n* http://code.google.com/p/gwt-lzma/ and https://github.com/nmrugg/LZMA-JS\n  are ports of the original Java code in the 7-Zip SDK\n  using the GWT Java-to-JavaScript compiler.\n\n## License\n\n> Copyright (c) 2011 Gary Linscott\n>\n> Copyright (c) 2011-2012 Juan Mellado\n>\n> Copyright (c) 2013 C. Scott Ananian\n>\n> All rights reserved.\n>\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n> THE SOFTWARE.\n\n[1]: https://travis-ci.org/cscott/lzma-purejs.png\n[2]: https://travis-ci.org/cscott/lzma-purejs\n[3]: https://david-dm.org/cscott/lzma-purejs.png\n[4]: https://david-dm.org/cscott/lzma-purejs\n[5]: https://david-dm.org/cscott/lzma-purejs/dev-status.png\n[6]: https://david-dm.org/cscott/lzma-purejs#info=devDependencies\n","readmeFilename":"README.md"}