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

play-js

v0.1.0

Published

Agnostic frame-skipping animation library

Readme

Play.js

Agnostic frame-skipping animation library

Performs an abstract transition for a fixed amount of time, regardless of the frame rate of the page (frame skipping.) Calls an onFrame callback with a 0-to-1 float ratio (representing the progress of the transition) as often as the browser can perform.

// Run a transition for one second
Play.start({
  time: 1,
  onFrame: function(r) {
    console.log('Animation is at ' + (r * 100).toFixed(2) + '%');
  }
});

// A custom transition easing can be set using the "easing" option, otherwise
// it defaults to linear.
Play.start({
  time: 0.1,
  easing: function(r) {
    // Similar to the default jQuery "swing" easing ($.easing.swing)
    return 0.5 - Math.cos(r * Math.PI) / 2;
  },
  onFrame: function(r) {
    // The first and last values will be closer, as the transition grows faster
    // in middle
    console.log(r);
  }
});

// Starting an animation returns a reference to its instance, exposing a few
// API methods
var myAnimation = Play.start({time: 5});

// You can stop an animation at any time...
Play.stop(myAnimation);
// ...or end it. The difference being that this time the onFrame handler will
// also be called on last time, with maximum ratio (1), as if the entire time
// for that animation had passed
Play.end(myAnimation);

// Another thing you can do is start a transition from a specific point in its
// development. This animation will go from 0.5 to 1 ratio and will last 500ms
Play.start({time: 1, ratio: 0.5});

// The beauty of the onFrame handler lays in its simplicity. You can use the
// frame ratio in any way you'd like, from rendering a progress bar to all
// sorts af complex DOM transitions
Play.start({time: 5, function(r) {
  $('.my-element').css({top: r / 2, left: r});
}});

// Play.js can also be installed as a npm package
var Play = require('play-js').Play;