You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 739B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # is-gif [![Build Status](https://travis-ci.com/sindresorhus/is-gif.svg?branch=master)](https://travis-ci.com/sindresorhus/is-gif)
  2. > Check if a Buffer/Uint8Array is a [GIF](https://en.wikipedia.org/wiki/Graphics_Interchange_Format) image
  3. ## Install
  4. ```
  5. $ npm install is-gif
  6. ```
  7. ## Usage
  8. ```js
  9. const readChunk = require('read-chunk');
  10. const isGif = require('is-gif');
  11. const buffer = readChunk.sync('unicorn.gif', 0, 3);
  12. isGif(buffer);
  13. //=> true
  14. ```
  15. ## API
  16. ### isGif(input)
  17. #### input
  18. Type: `Buffer` `Uint8Array`
  19. It only needs the first 3 bytes.
  20. ## Related
  21. - [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
  22. ## License
  23. MIT © [Sindre Sorhus](https://sindresorhus.com)