1 # is-gif [![Build Status](https://travis-ci.org/sindresorhus/is-gif.svg?branch=master)](https://travis-ci.org/sindresorhus/is-gif)
3 > Check if a Buffer/Uint8Array is a [GIF](http://en.wikipedia.org/wiki/Graphics_Interchange_Format) image
5 Used by [image-type](https://github.com/sindresorhus/image-type).
11 $ npm install --save is-gif
20 var readChunk = require('read-chunk'); // npm install read-chunk
21 var isGif = require('is-gif');
22 var buffer = readChunk.sync('unicorn.gif', 0, 3);
31 var xhr = new XMLHttpRequest();
32 xhr.open('GET', 'unicorn.gif');
33 xhr.responseType = 'arraybuffer';
35 xhr.onload = function () {
36 isGif(new Uint8Array(this.response));
48 Accepts a Buffer (Node.js) or Uint8Array.
50 It only needs the first 3 bytes.
55 MIT © [Sindre Sorhus](http://sindresorhus.com)