开发者社区> 镜像站> NPM> is-gif
is-gif
Check if a Buffer/Uint8Array is a GIF image
Last updated 2 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-gif 
SYNC missed versions from official npm registry.

is-gif Build Status

Check if a Buffer/Uint8Array is a GIF image

Install

$ npm install is-gif

Usage

const readChunk = require('read-chunk');
const isGif = require('is-gif');

const buffer = readChunk.sync('unicorn.gif', 0, 3);

isGif(buffer);
//=> true

API

isGif(input)

input

Type: Buffer Uint8Array

It only needs the first 3 bytes.

Related

  • file-type - Detect the file type of a Buffer/Uint8Array

License

MIT © Sindre Sorhus

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

5 Versions

  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago