is-gif
Check if a Buffer/Uint8Array is a GIF image
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-gif 
SYNC missed versions from official npm registry.

is-gif

Check if a Buffer/Uint8Array is a GIF image

Install

$ npm install is-gif

Usage

import {readChunk} from 'read-chunk';
import isGif from 'is-gif';

const buffer = await readChunk('unicorn.gif', {length: 3});

isGif(buffer);
//=> true

API

isGif(input)

Returns a boolean of whether input is a GIF image.

input

Type: Buffer | Uint8Array

It only needs the first 3 bytes.

Related

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

Current Tags

  • 4.0.1                                ...           latest (5 years ago)

7 Versions

  • 4.0.1                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 35
Today 0
This Week 1
This Month 19
Last Day 1
Last Week 2
Last Month 9
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE