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

@zhenre/animation

v0.1.0

Published

@zhenre animation — Angular-model enter/leave orchestration (literal CSS classes, framework-triggered, leave holds removal), FLIP reorder, stagger. Zero dependencies.

Readme

@zhenre/animation

Angular-model enter/leave orchestration — animations are defined in your CSS (classes + keyframes, or transitions paired with @starting-style); JS only decides when they play. The library adds exactly the classes you hand it, waits for the longest transition/animation, removes them. It invents no class names, ships no styles, no tweening, no per-frame JS. Zero dependencies.

<style>
  .fade-in   { animation: fade .2s ease; }
  .fade-out  { animation: fade .2s ease reverse; }
  /* transition form — @starting-style is the from-state, no extra classes */
  .slide-in  { translate: 0 0; transition: translate .2s ease;
               @starting-style { translate: 0 -100%; } }
</style>
import { animateEnter, animateLeave, animateSwap, stagger, flip, eachAnim } from '@zhenre/animation';
import { each, mountEach } from '@zhenre/core';

// standalone
await animateEnter(el, 'fade-in');            // literal class → wait → removed
await animateLeave(el, ['a', 'b']);           // array / space-separated both fine
await animateLeave(el, 'fade-out'); el.remove();

// JS-library escape hatch (GSAP / anime.js / WAAPI) — call done() when finished;
// an auto-done guard fires after `timeout` (default 4000, Angular's MAX_ANIMATION_TIMEOUT)
await animateEnter(el, (el, done) => {
  gsap.fromTo(el, { opacity: 0 }, { opacity: 1, onComplete: () => done() });
});

// framework-triggered (the Angular way): rows entering/leaving a keyed list
// are animated automatically — leave HOLDS the DOM removal until it settles
const view = mountEach(tbody, each(rows, r => r.id, rowTpl, {
  anim: eachAnim('fade-in', 'fade-out'),
}));
each(rows, r => r.id, rowTpl, { anim: eachAnim({ enter: 'in', leave: gsapOut, timeout: 6000 }) });

Pair it with the router for animated route changes:

router.outlet(el, render, {
  transition: (a, b) => animateSwap(a, b, 'fade-out', 'fade-in'),
});

Semantics (Angular animate.enter / animate.leave)

  • Literal classes — what you give is what gets added. No {name}-enter-from protocol, no prefix invention. Your CSS is the single source of truth.
  • Longest-wait completion — the runner reads the element's computed transition/animation durations, listens for transitionend/animationend (capture, first hit wins) and keeps a duration-derived timeout as the ceiling: it can neither hang (no event) nor cut off early (event lost). Zero-duration CSS (tests) resolves immediately.
  • leave holds removal — inside each(..., { anim }), a removed row's node stays in place (fading "ghost") until its leave settles, then the framework removes it — no matter what (throw, rejection, timeout). The list ledger splices immediately; keys stay coherent.
  • fn receivers — (el, done) => void for GSAP-style libraries; the auto-done timeout (default 4s, configurable per spec) guarantees completion.
  • Scope — enter fires when a row enters the DOM (initial fill included); leave plays for rows the list drops while alive. Whole-view teardown (dispose()) is instant, mirroring Angular's same-template rule.

stagger() (incremental inline delays, restored after) and flip() (FLIP reorder via native WAAPI transforms — keyframes are necessarily built at runtime from measured deltas) are the two imperative helpers that complement the declarative layer.

Class protocol summary: none. Bring your own class names.