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

@weasel-js/animator

v1.11.0

Published

The weasel animator: tweens, springs, holds, staggers, and timelines that combine on targets, run by one frame loop. Needs no scene; the root entry has no React, and the hook is under /react.

Readme

@weasel-js/animator

Tweens, springs, holds, staggers, and timelines on one frame loop, with no scene underneath.

Part of weasel, a domain-agnostic 2D scene-graph canvas kit for React. See the API reference.

npm install @weasel-js/animator
import { createTarget } from '@weasel-js/animator';
import { useAnimator } from '@weasel-js/animator/react';

const animator = useAnimator();
let x = 0;
const target = createTarget({ get: () => x, set: (v) => { x = v; }, show: draw });

animator.tween({ target, to: 100, ms: 300 });
animator.spring({ target, to: 40 }); // bends the motion; neither cancels the other

| Export | What it is | |---|---| | useAnimator() | The animator: tween, spring, physics, decay, hold, loop, stagger, timeline, watch, and live, with pause, resume, and setTimeScale over everything it runs. The frame loop stops while its host is unseen. | | createTarget(opts) | One value an animator moves. Animations on a target add, so a second one bends the first. target.axisIndexes(['y']) answers where the axes it names sit among the target's numbers. | | createTargetTable(opts) | Many like values as rows of flat arrays, shown in one pass. | | sampleTrack, the Track types | Keyframe tracks for animator.timeline. | | resolveSkeleton, skeletonAxes, solveIk, mirrorPose | Skeleton math: joints to matrices, a skeleton pose as a target's axes, two-bone IK. | | tweenVertexColors and its siblings, ColorOverrideRegistry | Per-vertex color animation, and the table a renderer reads the colors from. | | createSlew, slewToward | A value that follows another at a bounded rate. |

A hold or a timeline track over part of a target names the axes it holds, by the value's own fields or by index. A rig's pose target names its axes <joint>.<field>, so a joint's name reaches all five of its axes:

animator.hold({ target, value: { x: 0, y: 120 }, axes: ['y'] });
animator.hold({ target: rig.target, value: pose, axes: ['armL', 'foreL.rotation'] });

animator.stagger(items, delay) answers a builder. Its .tween and .spring move the items themselves where they are targets, a target named per item otherwise, and hand values to onTick with neither; .each runs any factory.

animator.stagger(targets, 80).spring({ to: (target) => ({ ...target.committed(), y: 200 }), preset: 'wobbly' });
animator.stagger(rows, 80).tween({ target: (row) => row.target, to: 1, ms: 300 });

Moving a scene node's pose is @weasel-js/core's half: tweenPose, springPose, momentum, bindRig, and useAnimatedReflow drive this animator against a scene. How animations combine on a target is in concepts under "Animation target".