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 🙏

© 2026 – Pkg Stats / Ryan Hefner

animation-chain

v0.5.0

Published

Animation Chain is a chaining library which utilizes the browser's `requestAnimationFrame` function in place of the usual `setTimeout`. This results in a much more accurate representation of time passed based on a delta time calculation. This can be usefu

Readme

Animation Chain

Animation Chain is a chaining library which utilizes the browser's requestAnimationFrame function in place of the usual setTimeout. This results in a much more accurate representation of time passed based on a delta time calculation. This can be useful in timing class additions and removals based on CSS transition timings.

Set Up

  • Clone the repo
  • Run npm install to install dependancies
  • Run grunt to build the files into the public/ dir

Usage

animation-chain is invoked the same way that setTimeout is, with the chainTo function being added to easily integrate successive function calls. Like promises for certain amounts of time or events

setTimeout(function(){console.log('old')}, 500);
chain(function(){console.log('new')}, 500);

Here's a use case for a slightly longer timeout (useful in chaining animations through adding classes)

setTimeout(function() {
  el.classList.toggle("animation1");
  setTimeout(function() {
    el.classList.toggle("animation2");
  }, 500)
}, 500);
chain(function() {
  el.classList.toggle("animation1");
}, 500).chainTo(function() {
  el.classList.toggle("animation2");
}, 500);

All while being more performant based on animation frame usage

You can also tap into the transition and animation events like so

var chainObject = {
  selector: '.animating-el',
  callback: function() {
    console.log('animation-ended')
  },
  animationType: 'transition'
}

chain(chainObject);

Options

callback: The callback to be executed when animation/timeout ends

animationType: Defaults to transition can also be animation if keyframes are being used

time: If using a timeout, the time to be used

singleListener: Defaults to true. Whether to only allow one event listener on a given element at a time. This can be useful when working with animations that can be stopped partway through so the event listener doesn't fire at the wrong end of the animation

Fallbacks

If you're planning on utilizing timing events but want to support browsers that don't support those events, simply pass a time into your object with the correct amount of time the animation. The plugin will detect that those events are supported and default to the timeout

Useful grunt tasks

  • lint - Check your code

Examples

Run npm run examples to start a server and view the different examples

This starts a server running at localhost:8080/

Coming soon

~~Support for transitionEnd events~~