Pathologic was missing because of a .git folder inside.
[yaffs-website] / node_modules / is-gif / readme.md
1 # is-gif [![Build Status](https://travis-ci.org/sindresorhus/is-gif.svg?branch=master)](https://travis-ci.org/sindresorhus/is-gif)
2
3 > Check if a Buffer/Uint8Array is a [GIF](http://en.wikipedia.org/wiki/Graphics_Interchange_Format) image
4
5 Used by [image-type](https://github.com/sindresorhus/image-type).
6
7
8 ## Install
9
10 ```sh
11 $ npm install --save is-gif
12 ```
13
14
15 ## Usage
16
17 ##### Node.js
18
19 ```js
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);
23
24 isGif(buffer);
25 //=> true
26 ```
27
28 ##### Browser
29
30 ```js
31 var xhr = new XMLHttpRequest();
32 xhr.open('GET', 'unicorn.gif');
33 xhr.responseType = 'arraybuffer';
34
35 xhr.onload = function () {
36         isGif(new Uint8Array(this.response));
37         //=> true
38 };
39
40 xhr.send();
41 ```
42
43
44 ## API
45
46 ### isGif(buffer)
47
48 Accepts a Buffer (Node.js) or Uint8Array.
49
50 It only needs the first 3 bytes.
51
52
53 ## License
54
55 MIT © [Sindre Sorhus](http://sindresorhus.com)