{"name":"@xhmikosr/archive-type","version":"6.0.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":">=16"},"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":"^5.3.0","xo":"^0.54.2"},"gitHead":"7babd1bd52bbcfd00649f69c4e3c843df5478f59","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"homepage":"https://github.com/XhmikosR/archive-type#readme","_id":"@xhmikosr/archive-type@6.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-dqBzNDfSdoFjj3OnhLfMggtdDXqZjV+GlL657CSjnRlTKlb8zag3wJjBeUMlRCUlXGRy0KB2eYoqjnIMC3e7NA==","shasum":"a77a4509bc221db0122496ee9e2b5cefbffe2280","tarball":"http://registry-npm.ywwl.com/@xhmikosr/archive-type/download/@xhmikosr/archive-type-6.0.0.tgz","fileCount":4,"unpackedSize":3387,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7Hy4rD6RTXPdMx/labkNcM0wbDZJrJfjv3QnsWE3liAiA0RNm09VTOMx6EJcmcrMK8/q7dyS++bqfccClJ+/O//A=="}],"size":1862,"noattachment":false,"key":"/@xhmikosr/archive-type/-/@xhmikosr/archive-type-6.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/archive-type_6.0.0_1685964961258_0.4403521933975909"},"_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":1685964961435,"_cnpm_publish_time":1685964961435,"dist-tags":{"latest":"8.1.0"}}