{"name":"@xhmikosr/decompress","version":"5.0.0","description":"Extracting archives made easy","license":"MIT","repository":{"type":"git","url":"git+https://github.com/XhmikosR/decompress.git"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":"^12.20.0 || ^14.14.0 || >=16.0.0"},"scripts":{"ava":"ava","xo":"xo","test":"npm run xo && npm run ava","test-ci":"npm run xo && c8 ava"},"main":"index.js","type":"module","exports":{".":"./index.js"},"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.1.1","decompress-tarbz2":"^4.1.1","decompress-targz":"^4.1.1","decompress-unzip":"^4.0.1","graceful-fs":"^4.2.10","make-dir":"^3.1.0","pify":"^5.0.0","strip-dirs":"^3.0.0"},"devDependencies":{"ava":"^4.3.0","c8":"^7.11.3","is-jpg":"^3.0.0","path-exists":"^5.0.0","rimraf":"^3.0.2","xo":"^0.49.0"},"gitHead":"6d80f3dac5977e29579611a388f684528db2ac4d","bugs":{"url":"https://github.com/XhmikosR/decompress/issues"},"homepage":"https://github.com/XhmikosR/decompress#readme","_id":"@xhmikosr/decompress@5.0.0","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-2bcQXuPmtxlodAHdD0DVM/HTMwqaCiOAtqSBcqUhZVp+pGNCuwgaZfixlzFqb4h/o4ZVdMuFXfNdwkVBgzUxUA==","shasum":"11b56fd31fdba361323fa0072bc357245166d307","tarball":"http://registry-npm.ywwl.com/@xhmikosr/decompress/download/@xhmikosr/decompress-5.0.0.tgz","fileCount":4,"unpackedSize":8658,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHC8W9cQBbTwBBzu6UgeKBwoE/DHNBakM82WFF2cBcDtAiEAve8zPC1yUhWp20EjqSfPmk4ASSJTmQNrdgIffAeWNHI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEWikACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPAw/+PjTt+TwUyzVn84HqhCZytDng5yixJXCsuNPzJRheHHiQrmya\r\nljl5CP13Zrk5mS0uJ2AijsShrPjnV9rojqg774l/yz7MeVcsnIrjVgOG4nsF\r\n0FkW599QK17Os2R/FSveES2Ckkp/FwTdIfrteLuhxrObAe0SE0W7Ye36Mgtf\r\nOgBHA/dHaS3Lgb8GrBgXKsf91dHw3n1+l7DRltR9tSijR1bqYffmc5VARDhN\r\ng87mu8DY+2E+pBm1FRX5ZnrqpEoJsfRGXAa878dH0PUmUr41huzeipTvrknD\r\nlan9x/YZQI1cjLz9d1gIcsi3XfELD4gwyQax6avahMOoPbrX7C3cIx7geA/Y\r\nYle+VA8oNNjEjX1mt9rNOJu2nGlMz9ZYl2WzIvmfW6jCY9iE0wRt4io0N3Vf\r\nTso1rNQUTum9xiBCUYQlBg16WlI0E0NRCHErpl7F+2HDvrFkxfU7Qh01dR5D\r\nNDZTo4NCWFe0mWSrSiTwTgURAUXeKaCVKITD3zqGICE4J0/GNWVGGAGl3fg2\r\nxxidTE2EWfQNFbwfmukNgSkojEHId+J2heSSG79BODoHeDQ6ZjdCVdvoZFmP\r\nh8vljsqvePzfX7cYRBs58makmwO6oE+xQQHt3ARVTBfE8tpYsjfvMK8ONlzS\r\nqT7OnpMSKGBHa/p/Tq5g5V7zBNfSIYfuP1s=\r\n=iIyQ\r\n-----END PGP SIGNATURE-----\r\n","size":3423,"noattachment":false,"key":"/@xhmikosr/decompress/-/@xhmikosr/decompress-5.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decompress_5.0.0_1678862500262_0.2574992621542078"},"_hasShrinkwrap":false,"readme":"# decompress [![CI](https://github.com/XhmikosR/decompress/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/XhmikosR/decompress/actions/workflows/ci.yml)\r\n\r\n> Extracting archives made easy\r\n\r\n*See [decompress-cli](https://github.com/kevva/decompress-cli) for the command-line version.*\r\n\r\n## Install\r\n\r\n```sh\r\nnpm install @xhmikosr/decompress\r\n```\r\n\r\n\r\n## Usage\r\n\r\n```js\r\nimport decompress from '@xhmikosr/decompress';\r\n\r\ndecompress('unicorn.zip', 'dist').then(files => {\r\n\tconsole.log('done!');\r\n});\r\n```\r\n\r\n\r\n## API\r\n\r\n### decompress(input, [output], [options])\r\n\r\nReturns a Promise for an array of files in the following format:\r\n\r\n```js\r\n{\r\n\tdata: Buffer,\r\n\tmode: Number,\r\n\tmtime: String,\r\n\tpath: String,\r\n\ttype: String\r\n}\r\n```\r\n\r\n#### input\r\n\r\nType: `string` `Buffer`\r\n\r\nFile to decompress.\r\n\r\n#### output\r\n\r\nType: `string`\r\n\r\nOutput directory.\r\n\r\n#### options\r\n\r\n##### filter\r\n\r\nType: `Function`\r\n\r\nFilter out files before extracting. E.g:\r\n\r\n```js\r\ndecompress('unicorn.zip', 'dist', {\r\n\tfilter: file => path.extname(file.path) !== '.exe'\r\n}).then(files => {\r\n\tconsole.log('done!');\r\n});\r\n```\r\n\r\n*Note that in the current implementation, **`filter` is only applied after fully reading all files from the archive in memory**. Do not rely on this option to limit the amount of memory used by `decompress` to the size of the files included by `filter`. `decompress` will read the entire compressed file into memory regardless.*\r\n\r\n##### map\r\n\r\nType: `Function`\r\n\r\nMap files before extracting: E.g:\r\n\r\n```js\r\ndecompress('unicorn.zip', 'dist', {\r\n\tmap: file => {\r\n\t\tfile.path = `unicorn-${file.path}`;\r\n\t\treturn file;\r\n\t}\r\n}).then(files => {\r\n\tconsole.log('done!');\r\n});\r\n```\r\n\r\n##### plugins\r\n\r\n* Type: `Array`\r\n* Default: `[decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]`\r\n\r\nArray of [plugins](https://www.npmjs.com/browse/keyword/decompressplugin) to use.\r\n\r\n##### strip\r\n\r\n* Type: `number`\r\n* Default: `0`\r\n\r\nRemove leading directory components from extracted files.\r\n\r\n\r\n## License\r\n\r\nMIT © [Kevin Mårtensson](https://github.com/kevva)\r\n","publish_time":1678862500432,"_cnpm_publish_time":1678862500432,"dist-tags":{"latest":"11.1.4","release-v10":"10.2.2"}}