1.0.1 • Published 1 year ago
is-apng v1.0.1
is-apng
Check if a Buffer/Uint8Array is a Animated PNG / APNG image
Install
$ npm install is-apng
Usage
Node.js
import { readFile } from 'node:fs/promises'
import isApng from 'is-apng'
const buffer = await readFile('image.png')
isApng(buffer)
// => true
Browser
import isApng from 'is-apng'
const response = await fetch('image.png')
const buffer = await response.arrayBuffer()
isApng(new Uint8Array(buffer))
// => true
API
isApng(buffer)
Accepts a Buffer (Node.js) or Uint8Array. Returns a boolean
of whether buffer
is a APNG image.
buffer
The buffer to check.
Based on
- is-png - Check if a Buffer/Uint8Array is a PNG image by Sindre Sorhus
License
MIT © Philip van Heemstra