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

@multitrack/core

v0.1.1

Published

A scroll-driven animation engine with multi-track timeline architecture

Readme

@multitrack/core

A scroll-driven animation engine with a multi-track timeline architecture, inspired by video editing software. Pure TypeScript, zero dependencies.

Install

npm install @multitrack/core

Usage

import { Timeline, ScrollDriver } from "@multitrack/core";

const timeline = new Timeline({
  config: [
    { name: "intro", duration: 3, track: "main", easing: "linear" },
    { name: "feature", duration: 5, track: "main" },
    { name: "outro", duration: 3, track: "main", easing: "linear" },

    // Independent text track — overlaps freely with main
    { name: "buffer", duration: 4, track: "text" },
    { name: "caption", duration: 3, track: "text" },
  ],
});

// Connect to scroll position
const driver = new ScrollDriver(timeline, {
  container: document.querySelector("#scroll-container"),
});

// React to step changes
timeline.on("step:enter", ({ name }) => console.log("entered", name));
timeline.on("step:exit", ({ name }) => console.log("exited", name));

// Read opacity values at any scroll progress
const opacities = timeline.getOpacities();
// { intro: 0.8, feature: 0, outro: 0, buffer: 1, caption: 0 }

API

Timeline

The core engine. Resolves step configs into absolute positions and calculates opacity values at any scroll progress.

const timeline = new Timeline({ config, breakpoints?, devtools? });

timeline.setProgress(0.5);           // Set playhead position (0–1)
timeline.getOpacities();             // Get all step opacities
timeline.getCurrentSteps();          // Get currently active steps
timeline.on("step:enter", handler);  // Listen to events
timeline.use(middleware);            // Add middleware
timeline.scope(() => { ... });       // Scoped subscriptions
timeline.dispose();                  // Clean up

ScrollDriver

Connects a Timeline to a scrollable DOM element, translating scroll position into timeline progress.

Easings

Built-in presets: snap (default — binary 0/1), linear, easeIn, easeOut, easeInOut. Or pass a custom function.

{ name: "fade", duration: 3, track: "main", easing: "linear" }
{ name: "custom", duration: 4, track: "main", easing: (t) => t * t }

Middleware

Intercept step:enter and step:exit events:

timeline.use((event, next) => {
  analytics.track(event.type, event.payload.name);
  next();
});

Responsive tracks

Include or exclude steps based on named breakpoints tied to CSS media queries:

const timeline = new Timeline({
  config: [
    { name: "mobile-hero", duration: 5, track: "main", when: "mobile" },
    { name: "desktop-hero", duration: 8, track: "main", when: "desktop" },
  ],
  breakpoints: {
    mobile: "(max-width: 767px)",
    desktop: "(min-width: 768px)",
  },
});

Scope cleanup

Collect subscriptions into a scope and dispose them all at once — similar to GSAP's gsap.context().

const ctx = timeline.scope(() => {
  timeline.on("step:enter", handleEnter);
  timeline.on("scroll", handleScroll);
  timeline.use(loggingMiddleware);
});

// later: clean up everything at once
ctx.dispose();

Conditional steps

For runtime conditions beyond media queries, use the condition predicate. Steps where condition returns false are excluded from the resolved timeline.

{ name: "mobile-hero", duration: 5, track: "main", condition: () => window.innerWidth < 768 }

Dev-mode warnings

In development, the engine validates your config and warns about common mistakes:

  • Zero or negative duration steps
  • Using snap easing on long steps (likely unintended)
  • Lone tracks that might be typos
  • when references to undefined breakpoints

React bindings

See @multitrack/react for React hooks and components.

License

MIT