Detect the archive type of a Buffer/Uint8Array
npm install archive-type> Detect the archive type of a Buffer/Uint8Array
```
$ npm install --save archive-type
`js
const archiveType = require('archive-type');
const readChunk = require('read-chunk');
const buffer = readChunk.sync('unicorn.zip', 0, 262);
archiveType(buffer);
//=> {ext: 'zip', mime: 'application/zip'}
`
Returns an Object with:
- ext - One of the supported file typesmime
- - The MIME type
Or null when no match.
#### input
Type: Buffer Uint8Array
It only needs the first 262 bytes.
- 7zbz2
- gz
- rar
- tar
- zip
- xz
- gz`
-
- archive-type-cli - CLI for this module
MIT © Kevin Mårtensson