# is-gif

> Check if a Buffer/Uint8Array is a GIF image

Latest version **4.0.1** (published 2021-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-gif
pnpm add is-gif
yarn add is-gif
bun add is-gif
```

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2021-09-02 |
| First published | 2014-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/is-gif) |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | gif, graphics, image, picture, photo, type, detect, check, is, exif, binary, buffer, uint8array |

## Links

- npm: https://www.npmjs.com/package/is-gif
- Repository: https://github.com/sindresorhus/is-gif
- Homepage: https://github.com/sindresorhus/is-gif#readme
- Issues: https://github.com/sindresorhus/is-gif/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-gif

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2021-09-02
- 4.0.0 — 2021-09-01
- 3.0.0 — 2018-11-02
- 2.0.0 — 2017-12-31
- 1.0.0 — 2014-08-14
- 0.1.1 — 2014-04-29
- 0.1.0 — 2014-04-21

## README

# is-gif

> Check if a Buffer/Uint8Array is a [GIF](https://en.wikipedia.org/wiki/Graphics_Interchange_Format) image

## Install

```
$ npm install is-gif
```

## Usage

```js
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](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array

---
_Source: https://npm.io/package/is-gif · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
