{"name":"@xhmikosr/decompress","version":"10.0.0","description":"Extracting archives made easy","license":"MIT","repository":{"type":"git","url":"git+https://github.com/XhmikosR/decompress.git"},"publishConfig":{"access":"public"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"https://github.com/kevva"},"engines":{"node":">=18"},"scripts":{"ava":"ava","lint":"xo","xo":"xo","fix":"xo --fix","test":"npm run xo && npm run ava","test-ci":"c8 ava"},"main":"index.js","type":"module","exports":{".":"./index.js"},"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"@xhmikosr/decompress-tar":"^8.0.0","@xhmikosr/decompress-tarbz2":"^8.0.0","@xhmikosr/decompress-targz":"^8.0.0","@xhmikosr/decompress-unzip":"^7.0.0","graceful-fs":"^4.2.11","make-dir":"^4.0.0","strip-dirs":"^3.0.0"},"devDependencies":{"ava":"^6.1.2","c8":"^9.1.0","is-jpg":"^3.0.0","path-exists":"^5.0.0","xo":"^0.58.0"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"_id":"@xhmikosr/decompress@10.0.0","gitHead":"b49f9daf4a89e3f5c9e76c491e6ae5cab753e7ea","bugs":{"url":"https://github.com/XhmikosR/decompress/issues"},"homepage":"https://github.com/XhmikosR/decompress#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-cP+DT+cXE9iHfLHVwsvjzcPoKM1RdS+eXG+8cIujSNEf9vZevi2TGFsIReCtkTe+PmsDGgnhOdi/7ey/7wkxYw==","shasum":"7d639edf1d19e6e705a3c410e8f67d3b4f5ba1b5","tarball":"http://registry-npm.ywwl.com/@xhmikosr/decompress/download/@xhmikosr/decompress-10.0.0.tgz","fileCount":4,"unpackedSize":9052,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbHcOOyRxaKpnffsdeg5HAGC1YWMzFGUEbZFAaHNNdAAiEAqE/YRJvDbEeTTbfdqKSYiaqatx56pQ2iDL7Ztcuaz/k="}],"size":3549,"noattachment":false,"key":"/@xhmikosr/decompress/-/@xhmikosr/decompress-10.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_10.0.0_1711952870285_0.057644637847145574"},"_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":1711952870461,"_cnpm_publish_time":1711952870461,"dist-tags":{"latest":"11.1.4","release-v10":"10.2.2"}}