is-apng
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

is-apng   Latest GitHub release Latest NPM version Build Status

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  Chrome Edge Firefox Safari Opera

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

License

MIT © Philip van Heemstra

Package Sidebar

Install

npm i is-apng

Weekly Downloads

849

Version

1.0.1

License

MIT

Unpacked Size

12.9 kB

Total Files

7

Last publish

Collaborators

  • vheemstra