{"name":"@xhmikosr/archive-type","version":"7.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":"^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","zst","zstd","file","type"],"dependencies":{"file-type":"^19.0.0"},"devDependencies":{"ava":"^6.1.2","xo":"^0.58.0"},"xo":{"rules":{"unicorn/prevent-abbreviations":"off"}},"_id":"@xhmikosr/archive-type@7.0.0","gitHead":"e52b3dde31468d3dff6c9cf92063958dfe75c3ca","bugs":{"url":"https://github.com/XhmikosR/archive-type/issues"},"homepage":"https://github.com/XhmikosR/archive-type#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-sIm84ZneCOJuiy3PpWR5bxkx3HaNt1pqaN+vncUBZIlPZCq8ASZH+hBVdu5H8znR7qYC6sKwx+ie2Q7qztJTxA==","shasum":"74746a210b59d7d8a77aa69a422f0dae025b3798","tarball":"http://registry-npm.ywwl.com/@xhmikosr/archive-type/download/@xhmikosr/archive-type-7.0.0.tgz","fileCount":4,"unpackedSize":3494,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICF59bihwS1XYc9s3fk9kwVM17wZvi4yaphd3tyejK3lAiEAzfRFXRkuZQ3981uLQUhXxrw7hyhZTc/Mmk39rO9pVmQ="}],"size":1931,"noattachment":false,"key":"/@xhmikosr/archive-type/-/@xhmikosr/archive-type-7.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_7.0.0_1711951946509_0.9839499660642415"},"_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":1711951946699,"_cnpm_publish_time":1711951946699,"dist-tags":{"latest":"8.1.0"}}