npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

anime-ts

v5.0.4

Published

A lightweight and flexible JS/TS animation library that provides smooth animation with precise control. Features include customizable durations, timing functions, delays, and lifecycle hooks. Perfect for creating performant web animations with minimal ove

Downloads

44

Readme

🎨 Animation Controller By JS/TS

A lightweight and powerful TypeScript library for creating smooth, controlled CSS transitions with minimal overhead.
Perfect for pure JS/TS, React, Next.js projects, and other libraries and frameworks.

✨ Features

  • 🚀 Lightweight & Fast: Pure TypeScript implementation with zero dependencies
  • 🎯 Type-Safe: Full TypeScript support for better development experience
  • ⚛️ Framework-Agnostic: Use in React, Vanilla JS, or any environment
  • 🎮 Fine Control: Precise lifecycle hooks for transitions (start, run, end, cancel)
  • Performance Focused: Uses native CSS transitions
  • 🛠️ Flexible API: Simple yet powerful
  • 🎭 Multiple Properties: Animate multiple CSS properties simultaneously
  • ⏱️ Timing Control: Supports numeric duration, easing, and delay

📦 Installation

npm install anime-ts
# or
yarn add anime-ts
# or
pnpm add anime-ts

🚀 Quick Start

import { An } from 'anime-ts';

// Animate opacity and transform
An(
   '#myElement',
   {
      opacity: '0',
      transform: 'translateY(20px)',
   },
   {
      time: 0.5, // duration in seconds
      ease: 'ease-out',
      delay: 0, // delay in seconds
   }
);

Using individual timings per property:

An(
   '#myElement',
   {
      opacity: {
         from: '1',
         to: '0.5',
         delay: 1, // in seconds
      },
      transform: {
         from: 'translateY(0)',
         to: 'translateY(20px)',
         time: 0.8,
         ease: 'ease-in-out',
         delay: 0.2,
      },
   },
   {
      time: 0.5,
      delay: 0,
   }
);

📖 API Reference

Constructor

An(
  target: string | HTMLElement,
  attributes: AttributeT,
  detail?: {
    time?: number;  // default time in seconds
    ease?: string;  // default easing function
    delay?: number;  // default delay in seconds
  }
)

🔧 Attribute Syntax

Each attribute can be:

  1. A string value (target value):

    {
       opacity: '0';
    }
  2. Or an object with detailed settings:

    {
      opacity: {
         from: '1',
         to: '0',
         time: 0.5,     // in seconds
         ease: 'ease-in',
         delay: 0.3     // in seconds
      }
    }

🔁 Lifecycle Hooks

const animation = An('#myElement', { opacity: '0.5' });

animation.onRun = () => console.log('Running...');
animation.onStart = () => console.log('Started');
animation.onCancel = () => console.log('Cancelled');
animation.onEnd = () => console.log('Completed');

⏹️ Stop Animation

animation.stop();

🎭 More Examples

An(
   '#box',
   {
      width: {
         from: '100px',
         to: '300px',
         time: 1,
         ease: 'ease-in-out',
      },
      background: {
         from: '#ff0000',
         to: '#00ff00',
         time: 1.5,
      },
   },
   {
      time: 0.8,
      ease: 'ease-out',
      delay: 0,
   }
);

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, open an issue to discuss first.


📄 License

MIT License – see the LICENSE.md for details.


Made with ❤️ in TypeScript