Package Exports
- is-file-animated
- is-file-animated/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-file-animated) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-file-animated
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-animatedExample
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}.`)