Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-file-animated

saschanaz9.4kMIT1.0.2TypeScript support: included

Detects animated images from file handles e.g. Blob/File or fs.FileHandle

animated, animated gif, animated image, animated png, animated webp, animation, apng, gif, png, webp

readme

is-file-animated

npm ci standard standard version

is-file-animated is a simple library for detecting animated GIF/PNG/WebP images from Blob/File or fs.FileHandle.

Install

npm install is-file-animated

Example

On browsers and similar environments:

import isAnimated from 'https://cdn.jsdelivr.net/npm/is-file-animated/+esm'

const response = await fetch(url)

const blob = await response.blob()
const answer = await isAnimated(blob) ? 'Yes' : 'No'
console.log(`Is "${url}" animated? ${answer}.`)

On Node.js:

import { open } from 'fs/promises'
import isAnimated from 'is-file-animated'

const filename = process.argv[2]

const handle = await open(filename)
const answer = await isAnimated(handle) ? 'Yes' : 'No'
console.log(`Is "${filename}" animated? ${answer}.`)

License

MIT

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.2 (2022-01-13)

Bug Fixes

  • apng files with multiple IDAT/fdAT chunks in single frame (69dad3c), closes #16

2.0.0 (2019-03-25)

Bug Fixes

Chores

  • use convetional-commits for commit messages (24e86b9)

Features

BREAKING CHANGES

  • drop support for following Node.js versions: 0.10.x, 0.12.x, 4.x.x, 6.x.x

1.1.1 (2019-08-30)

1.1.0 (2016-08-24)

Code Refactoring

  • drop support for node 0.8.x (232c2d0)

Features

BREAKING CHANGES

  • support for node 0.8.x dropped

1.0.0 (2019-06-06)

Features