{"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":"http://registry-npm.ywwl.com/@xhmikosr/archive-type/download/@xhmikosr/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,"size":1942,"noattachment":false,"key":"/@xhmikosr/archive-type/-/@xhmikosr/archive-type-7.1.0.tgz"},"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"},"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":1753191915488,"_cnpm_publish_time":1753191915488,"dist-tags":{"latest":"8.1.0"}}