{"_id":"@xhmikosr/archive-type","_rev":"8-10769588cabf72e64e9e535e67ba7a14","name":"@xhmikosr/archive-type","dist-tags":{"latest":"8.1.0"},"versions":{"5.0.0":{"name":"@xhmikosr/archive-type","version":"5.0.0","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@5.0.0","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"dist":{"shasum":"e1423158aad89ff424f7c78d42d941e879d30ad2","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-5.0.0.tgz","fileCount":4,"integrity":"sha512-l86YsKFntDpWs9BngiGD23+PdpKJMdmWIlSUGDMINx0k5eSfbV2zzAJyiwnG0gt+FammSlrLlsIlliCabAXIsg==","signatures":[{"sig":"MEYCIQDGXFyuiX3/X2STUlToMz7VxP+3B89VF8Q4tobhhDMtWQIhAKT45mShjCMzXp2VH/FOW45BzDuUuETyv4oopa8etpQd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3368},"main":"index.js","type":"module","engines":{"node":"^14.14.0 || >=16.0.0"},"exports":{".":"./index.js"},"gitHead":"f5e20ac2ec9a9394c0a0a77ef92ebff724853324","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"9.5.1","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"18.16.0","dependencies":{"file-type":"^12.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_5.0.0_1685626963805_0.10347724046286766","host":"s3://npm-registry-packages"}},"6.0.0":{"name":"@xhmikosr/archive-type","version":"6.0.0","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@6.0.0","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"dist":{"shasum":"a77a4509bc221db0122496ee9e2b5cefbffe2280","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-6.0.0.tgz","fileCount":4,"integrity":"sha512-dqBzNDfSdoFjj3OnhLfMggtdDXqZjV+GlL657CSjnRlTKlb8zag3wJjBeUMlRCUlXGRy0KB2eYoqjnIMC3e7NA==","signatures":[{"sig":"MEQCIF7Hy4rD6RTXPdMx/labkNcM0wbDZJrJfjv3QnsWE3liAiA0RNm09VTOMx6EJcmcrMK8/q7dyS++bqfccClJ+/O//A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3387},"main":"index.js","type":"module","engines":{"node":">=16"},"exports":{".":"./index.js"},"gitHead":"7babd1bd52bbcfd00649f69c4e3c843df5478f59","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"9.5.1","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"18.16.0","dependencies":{"file-type":"^18.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_6.0.0_1685964961258_0.4403521933975909","host":"s3://npm-registry-packages"}},"6.0.1":{"name":"@xhmikosr/archive-type","version":"6.0.1","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@6.0.1","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"dist":{"shasum":"684e9e5369bfa93223d7aeb2c84fe0780d6d5e24","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-6.0.1.tgz","fileCount":4,"integrity":"sha512-PB3NeJL8xARZt52yDBupK0dNPn8uIVQDe15qNehUpoeeLWCZyAOam4vGXnoZGz2N9D1VXtjievJuCsXam2TmbQ==","signatures":[{"sig":"MEUCIQD62opZm0ZwObrfDMGuzkKzletdwTca7h70xIvjnlEBtgIgdjm9R5BIYu+nWAq+7IG7UNHR9UOKfNGidAScQKeTR00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3403},"main":"index.js","type":"module","engines":{"node":"^14.14.0 || >=16.0.0"},"exports":{".":"./index.js"},"gitHead":"bb2f5d11757d6ce35165337b595114228ba0c17c","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"9.5.1","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"18.16.0","dependencies":{"file-type":"^18.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^4.3.3"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_6.0.1_1685973173285_0.667786072240065","host":"s3://npm-registry-packages"}},"7.0.0":{"name":"@xhmikosr/archive-type","version":"7.0.0","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","zst","zstd","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@7.0.0","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"dist":{"shasum":"74746a210b59d7d8a77aa69a422f0dae025b3798","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-7.0.0.tgz","fileCount":4,"integrity":"sha512-sIm84ZneCOJuiy3PpWR5bxkx3HaNt1pqaN+vncUBZIlPZCq8ASZH+hBVdu5H8znR7qYC6sKwx+ie2Q7qztJTxA==","signatures":[{"sig":"MEUCICF59bihwS1XYc9s3fk9kwVM17wZvi4yaphd3tyejK3lAiEAzfRFXRkuZQ3981uLQUhXxrw7hyhZTc/Mmk39rO9pVmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3494},"main":"index.js","type":"module","engines":{"node":"^14.14.0 || >=16.0.0"},"exports":{".":"./index.js"},"gitHead":"e52b3dde31468d3dff6c9cf92063958dfe75c3ca","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"10.5.0","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"20.12.0","dependencies":{"file-type":"^19.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^6.1.2"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_7.0.0_1711951946509_0.9839499660642415","host":"s3://npm-registry-packages"}},"7.1.0":{"name":"@xhmikosr/archive-type","version":"7.1.0","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","zst","zstd","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@7.1.0","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"dist":{"shasum":"2983bcc547e119cdd345e50abaaeb6b7097daa44","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-7.1.0.tgz","fileCount":4,"integrity":"sha512-xZEpnGplg1sNPyEgFh0zbHxqlw5dtYg6viplmWSxUj12+QjU9SKu3U/2G73a15pEjLaOqTefNSZ1fOPUOT4Xgg==","signatures":[{"sig":"MEYCIQDQEnW4ABnYrZkIJN85OW6Ob4AimtMEplcyaf6yxXVIiAIhAOj1aM0rAHoL+GyEiS03/oF/fTv6opRzXuwEXv6HGFzl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3536},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js"},"gitHead":"99e39b2ba5a23d26f7f82663daa0573888e499d7","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"10.9.2","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"22.17.1","dependencies":{"file-type":"^20.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.60.0","ava":"~6.2.0"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_7.1.0_1753191915278_0.855498636965405","host":"s3://npm-registry-packages-npm-production"}},"8.0.0":{"name":"@xhmikosr/archive-type","version":"8.0.0","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","zst","zstd","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@8.0.0","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"dist":{"shasum":"3ea75f49b36449658ebb8a9c917b7d3acd8357ef","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-8.0.0.tgz","fileCount":4,"integrity":"sha512-U6zgcbvzKFToOtlEDzodMY4uiJbhAV9QB6SXJtUbarmIWXlvO90svKPK+WbzB9pZMR7FFo3jGZoXYTRmhrzlwg==","signatures":[{"sig":"MEUCIF2g5n+stXmRXRUkeGkA3TaOhOlpLIBIp16blViTIMiyAiEA5rQer6DftHopfr8dpeLAPY0TXSasmuupvf/FI9FrATo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3739},"main":"index.js","type":"module","engines":{"node":">=20"},"exports":{".":"./index.js"},"gitHead":"5bca1711877bc12b505782e1f136bea160cabdc1","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"11.8.0","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"24.13.1","dependencies":{"file-type":"^21.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_8.0.0_1771953745595_0.07621770647600656","host":"s3://npm-registry-packages-npm-production"}},"8.0.1":{"name":"@xhmikosr/archive-type","version":"8.0.1","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","rar","zip","zst","zstd","file","type"],"author":{"url":"https://github.com/kevva","name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com"},"license":"MIT","_id":"@xhmikosr/archive-type@8.0.1","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/XhmikosR/archive-type#readme","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"dist":{"shasum":"ef2db3325fc2e47d46fb8381b6316e16eec37894","tarball":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-8.0.1.tgz","fileCount":4,"integrity":"sha512-toXuiWChyfOpEiCPsIw6HGHaNji5LVkvB6EREL548vGWr+hGaehwxG4LzN20vm9aGFXwnA/Jty8yW2/SmV+1zQ==","signatures":[{"sig":"MEUCIQDTReCPFHWDBWEdIU1JtAKqi9L6rfQyCFnGOUC9im/X5AIgKVPj4AVKDjND2Ly4WdM/XzgEvAi9BjJQlbR5+hxpUKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3743},"main":"index.js","type":"module","engines":{"node":">=20"},"exports":{".":"./index.js"},"gitHead":"7b0baa97c85b028bdd32703d5037091f782344d8","scripts":{"xo":"xo","ava":"ava","fix":"xo --fix","lint":"xo","test":"npm run ava"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/XhmikosR/archive-type.git","type":"git"},"_npmVersion":"11.8.0","description":"Detect the archive type of a Buffer/Uint8Array","directories":{},"_nodeVersion":"24.13.1","dependencies":{"file-type":"^21.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/archive-type_8.0.1_1771958328958_0.6047844405455272","host":"s3://npm-registry-packages-npm-production"}},"8.1.0":{"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":"https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-8.1.0.tgz","fileCount":4,"unpackedSize":4428,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5NGioq+rPvrvZpMfHnXDP/hFFdGAYOtM7qqJwtYRX0wIgVfZcBe11v9+C4sldNLXjuE/kMfVjJJIz71NPnOsTOH0="}]},"_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}},"time":{"created":"2023-06-01T13:42:43.740Z","modified":"2026-06-10T14:04:23.549Z","5.0.0":"2023-06-01T13:42:43.987Z","6.0.0":"2023-06-05T11:36:01.435Z","6.0.1":"2023-06-05T13:52:53.430Z","7.0.0":"2024-04-01T06:12:26.699Z","7.1.0":"2025-07-22T13:45:15.488Z","8.0.0":"2026-02-24T17:22:25.724Z","8.0.1":"2026-02-24T18:38:49.110Z","8.1.0":"2026-06-10T14:04:23.423Z"},"bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"https://github.com/kevva"},"license":"MIT","homepage":"https://github.com/XhmikosR/archive-type#readme","keywords":["7zip","archive","buffer","bz2","bzip2","check","detect","gz","gzip","mime","pkg","rar","tar.gz","tar","zip","zst","zstd","file","type"],"repository":{"type":"git","url":"git+https://github.com/XhmikosR/archive-type.git"},"description":"Detect the archive type of a Buffer/Uint8Array","maintainers":[{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"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","readmeFilename":"readme.md"}