{"name":"@xhmikosr/archive-type","version":"6.0.1","description":"Detect the archive type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/XhmikosR/archive-type.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 ava"},"main":"index.js","type":"module","exports":{".":"./index.js"},"keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","file","type"],"dependencies":{"file-type":"^18.5.0"},"devDependencies":{"ava":"^4.3.3","xo":"^0.54.2"},"gitHead":"bb2f5d11757d6ce35165337b595114228ba0c17c","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"homepage":"https://github.com/XhmikosR/archive-type#readme","_id":"@xhmikosr/archive-type@6.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-PB3NeJL8xARZt52yDBupK0dNPn8uIVQDe15qNehUpoeeLWCZyAOam4vGXnoZGz2N9D1VXtjievJuCsXam2TmbQ==","shasum":"684e9e5369bfa93223d7aeb2c84fe0780d6d5e24","tarball":"http://registry-npm.ywwl.com/@xhmikosr/archive-type/download/@xhmikosr/archive-type-6.0.1.tgz","fileCount":4,"unpackedSize":3403,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD62opZm0ZwObrfDMGuzkKzletdwTca7h70xIvjnlEBtgIgdjm9R5BIYu+nWAq+7IG7UNHR9UOKfNGidAScQKeTR00="}],"size":1872,"noattachment":false,"key":"/@xhmikosr/archive-type/-/@xhmikosr/archive-type-6.0.1.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/archive-type_6.0.1_1685973173285_0.667786072240065"},"_hasShrinkwrap":false,"readme":"# archive-type [![CI](https://github.com/XhmikosR/archive-type/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/XhmikosR/archive-type/actions/workflows/ci.yml)\n\n> Detect the archive type of a Buffer/Uint8Array\n\n\n## Install\n\n```sh\nnpm install @xhmikosr/archive-type\n```\n\n\n## Usage\n\n```js\nimport archiveType from '@xhmikosr/archive-type';\nimport {readChunk} from 'read-chunk';\n\nconst buffer = await readChunk('unicorn.zip', 0, 262);\n\nawait archiveType(buffer);\n//=> {ext: 'zip', mime: 'application/zip'}\n```\n\n\n## API\n\n### archiveType(input)\n\nReturns an `Object` with:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Media_type)\n\nOr `null` when no match.\n\n#### input\n\nType: `Buffer` `Uint8Array`\n\nIt only needs the first 262 bytes.\n\n\n## Supported file types\n\n- `7z`\n- `bz2`\n- `gz`\n- `rar`\n- `tar`\n- `zip`\n- `xz`\n- `gz`\n- `zst`\n\n\n## Related\n\n- [archive-type-cli](https://github.com/kevva/archive-type-cli) - CLI for this module\n\n\n## License\n\nMIT © [Kevin Mårtensson](https://github.com/kevva)\n","publish_time":1685973173430,"_cnpm_publish_time":1685973173430,"dist-tags":{"latest":"8.1.0"}}