Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@frsource/is-animated

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frsource/is-animated

Detects animated images in browser & node. Supports GIT, APNG & WebP

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
94
decreased by-15.32%
Maintainers
0
Weekly downloads
 
Created
Source

NPM version badge GZIP size calculated by bundlejs.com semantic-release badge license MIT badge

is-animated - check if the image is animated 🎞

Getting Started · Demo · File an Issue · Have a question or an idea?


A simple library for detecting animated images.
Works under Node and Browser environments!
Performant & with small bundle size
Supports GIF, PNG, APNG and WebP
Fully typed in Typescript
Published under MIT license


Quick start

Installation

npm install @frsource/is-animated

yarn add @frsource/is-animated

pnpm add @frsource/is-animated

Usage in browser

<input type="file" accept="image/*" />
import isAnimated from '@frsource/is-animated';

const input = document.querySelector('input[type="file"]');

input.addEventListener('change', async function () {
  const arrayBuffer = await this.files[0].arrayBuffer();
  const answer = isAnimated(arrayBuffer) ? 'IS' : 'IS NOT';
  alert(`File "${this.files[0].name}" ${answer} animated.`);
});

If you prefer, you can import this library using unpkg: <script defer src="https://unpkg.com/@frsource/is-animated"></script>

Usage in Node.js

import { readFileSync } from 'fs';
import isAnimated from '@frsource/is-animated';

readFileSync('my-test-file.png', (err, buffer) => {
  const answer = isAnimated(buffer) ? 'IS' : 'IS NOT';
  console.log(`File "my-test-file.png" ${answer} animated.`);
});

Demo

For a working example, check out our demo.

Questions

Don’t hesitate to ask a question directly on the discussion board!

Changelog

Changes for every release are documented in the release notes and CHANGELOG file.

Development

  1. Check out the repository.
  2. Install dependencies using pnpm i.
  3. Run pnpm test to run the test suite.
  4. Run pnpm start and visit http://localhost:3000 to see the documentation page. You can test the library using the demo section.

License

MIT @ 2024-present, Jakub FRS Freisler, FRSOURCE

Forked from qzb's great library: is-animated.

Keywords

FAQs

Package last updated on 21 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc