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

@vosjs/tween

v0.8.2

Published

Records a GSAP-dialect timeline into a structured, per-element tween IR (TweenSpec/TimelineDoc) for extraction and editing — a recording facade that delegates 1:1 to a real tween backend while capturing the animation as data. For the vos programmatic vide

Readme

@vosjs/tween

Record a GSAP-dialect timeline into a per-target tween IR: a recording facade that delegates to a real backend for live playback while capturing the animation as data you can extract, retime and sample deterministically without GSAP.

npm License: MIT

Part of vos, the open programmatic video engine behind vos.so. vos configs author animation as GSAP-dialect createTimeline functions. This package lets that authoring surface become data: the recorder is shaped like the slice of gsap those functions use, captures every tween as a TweenSpec with position parameters resolved to absolute time, and, given a real gsap, delegates each call so live playback is unchanged. Without a backend the recording is played by a pure sampler, which is what makes a server render frame-identical to a browser preview. Its only dependency is @vosjs/timeline.

Install

pnpm add @vosjs/tween

The pieces

  • Recorder. createTweenRecorder(backend?) returns a gsap-shaped object: timeline(vars) gives a RecordingTimeline that records to, from, fromTo, set, add, labels, repeat and callbacks as TweenSpecs, and forwards to the backend when one is given. It also exposes utils and the list of timelines it created.
  • Retime overlay. timeline.applyEdits(edits) takes TweenEdit[] ({ index, startTime?, duration?, ease?, to?, from? }, addressed by recorded index) and applies them from the original recording every time, so an edit that leaves the overlay leaves the timeline. This is the seam the engine's SET_TWEEN_EDITS rides.
  • Extraction. extractTimeline(timeline) folds the recording into a TimelineDoc ({ duration, specs, tracks }) of per-target keyframe tracks; buildTracks(specs) is the half that takes bare specs. This is the neutral model a per-element timeline editor edits.
  • Deterministic sampler. createSampler(entries) evaluates recorded entries with no GSAP present; seek(t) writes the sampled values onto the targets. A backend-less RecordingTimeline seeks through it, so the same createTimeline plays anywhere.
  • Spec player. createSpecPlayer(resolve) plays a TweenSpec[] that lives in a document's data, resolving targets against a live context each frame through contextResolver(ctx, content): the timeline-as-data path.
  • Helpers. staggerOffsets, parseVars, target tagging (tagTarget, readTag, targetKey), and the extraction-scope stubs (makeElement, makeElementsMap, tagUniforms, tagRef, runCreateTimeline) that let a host run a config's createTimeline against stand-in content.

Example

import gsap from 'gsap'
import { createTweenRecorder, extractTimeline } from '@vosjs/tween'

// run a config's createTimeline with the recorder as ctx.gsap
// (pass gsap to keep live playback; omit it to record only)
const recorder = createTweenRecorder(gsap)
const tl = createTimeline({ ...ctx, gsap: recorder }, content, duration)

// the animation as data
const doc = extractTimeline(tl) // { duration, specs, tracks }

// retime tween #0 without touching the author's function
tl.applyEdits([{ index: 0, startTime: 0.5, duration: 1.2 }])

// with no backend, seek is a pure function: the sampler writes values onto the targets
createTweenRecorder().timeline().to(obj, { x: 100, duration: 1 }).seek(0.5)

runCreateTimeline(source, { gsap: recorder }, content, duration) does the first step from a function string, with the stubs a bare extraction needs.

@vosjs/tween/bundle exports tweenRuntimeCode, an inlinable string that defines globalThis.__vosTween (the recorder, the timeline, extraction, the spec player and the tagging helpers) for a compiled program's page.

License

MIT © vosso