{"name":"@xhmikosr/decompress","version":"7.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":"^14.14.0 || >=16.0.0"},"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":"^5.0.0","@xhmikosr/decompress-tarbz2":"^5.0.0","@xhmikosr/decompress-targz":"^5.0.0","@xhmikosr/decompress-unzip":"^5.0.0","graceful-fs":"^4.2.11","make-dir":"^3.1.0","strip-dirs":"^3.0.0"},"devDependencies":{"ava":"^5.3.0","c8":"^7.13.0","is-jpg":"^3.0.0","path-exists":"^5.0.0","xo":"^0.54.2"},"gitHead":"ddfb17b22686cfb8859dc4e2b601aef056ed9f0e","bugs":{"url":"https://github.com/XhmikosR/decompress/issues"},"homepage":"https://github.com/XhmikosR/decompress#readme","_id":"@xhmikosr/decompress@7.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-k0Qe1i3j0AyBZ6vil3oy7Tb5Up+buCnXfkJFOLzHctdc3cMeryrO6fNJ60VJbHeXhdzWiGOFQZ1cGfcYrabUpQ==","shasum":"714739e298659b6269c7eeee55fbc187539cff8f","tarball":"http://registry-npm.ywwl.com/@xhmikosr/decompress/download/@xhmikosr/decompress-7.0.0.tgz","fileCount":4,"unpackedSize":8930,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFT6giAcNJu3HUQcTPG/9gJaSvbbq3cAO6jVuBud4rFqAiEAknvnl+SxeLOuVzLuO55npTD+G0UmngBaclTrITsyT0k="}],"size":3471,"noattachment":false,"key":"/@xhmikosr/decompress/-/@xhmikosr/decompress-7.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_7.0.0_1685561367406_0.8339861892105194"},"_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":1685561367551,"_cnpm_publish_time":1685561367551,"dist-tags":{"latest":"11.1.4","release-v10":"10.2.2"}}