{"name":"@xhmikosr/archive-type","version":"8.1.0","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":">=20"},"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","pkg","rar","tar.gz","tar","zip","zst","zstd","file","type"],"dependencies":{"file-type":"^21.3.4"},"devDependencies":{"ava":"^7.0.0","xo":"^2.0.2"},"xo":{"rules":{"capitalized-comments":"off","unicorn/prevent-abbreviations":"off"}},"gitHead":"4e62e364e401c5e99e3e7fb9945e1f2f9e0db2d6","_id":"@xhmikosr/archive-type@8.1.0","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"homepage":"https://github.com/XhmikosR/archive-type#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-EXOjEbnZFE5c/nFMf4FOrEURVanzHpnkPYmnmr78u02/8hAhE0FMq8p9TK1IM0/bFr5VcyBUY0gfLm8f7dKy+Q==","shasum":"0e7cb065a81b8cab0020692072d55970b776e601","tarball":"http://registry-npm.ywwl.com/@xhmikosr/archive-type/download/@xhmikosr/archive-type-8.1.0.tgz","fileCount":4,"unpackedSize":4428,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5NGioq+rPvrvZpMfHnXDP/hFFdGAYOtM7qqJwtYRX0wIgVfZcBe11v9+C4sldNLXjuE/kMfVjJJIz71NPnOsTOH0="}],"size":2353,"noattachment":false,"key":"/@xhmikosr/archive-type/-/@xhmikosr/archive-type-8.1.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/archive-type_8.1.0_1781100263293_0.2131746773537977"},"_hasShrinkwrap":false,"readme":"# @xhmikosr/archive-type [![npm version](https://img.shields.io/npm/v/@xhmikosr/archive-type?logo=npm&logoColor=fff)](https://www.npmjs.com/package/@xhmikosr/archive-type) [![CI Status](https://img.shields.io/github/actions/workflow/status/XhmikosR/archive-type/ci.yml?branch=master&label=CI&logo=github)](https://github.com/XhmikosR/archive-type/actions/workflows/ci.yml?query=branch%3Amaster)\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- `pkg`\n- `rar`\n- `tar`\n- `tar.gz`\n- `xz`\n- `zip`\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":1781100263423,"_cnpm_publish_time":1781100263423,"dist-tags":{"latest":"8.1.0"}}