auspice
Version:
Web app for visualizing pathogen evolution
45 lines (23 loc) • 739 B
Markdown
> Check if a Buffer/Uint8Array is a [GIF](https://en.wikipedia.org/wiki/Graphics_Interchange_Format) image
```
$ npm install is-gif
```
```js
const readChunk = require('read-chunk');
const isGif = require('is-gif');
const buffer = readChunk.sync('unicorn.gif', 0, 3);
isGif(buffer);
//=> true
```
Type: `Buffer` `Uint8Array`
It only needs the first 3 bytes.
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
MIT © [Sindre Sorhus](https://sindresorhus.com)