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

@johnesleyer/clawmotion

v1.0.0

Published

Programmatic video motion engine for AI Agents

Readme

🦀 ClawMotion (v1.0.0)

License: ISC Agent-First

ClawMotion is a high-precision, programmatic video motion engine designed for AI Agents. Create complex video sequences using declarative blueprints and render with 100% parity between browser preview and server export.


✨ Key Features

  • 🏗️ Isomorphic Core: Same Blueprint logic runs in browser and Node.js
  • 🎯 100% Parity: Browser-based export ensures identical preview and output
  • 🧠 AI-Optimized: Declarative manifests easy for LLMs to generate. See LLM.md
  • 🎲 Deterministic Math: Seeded RNG and easing for frame-perfect reproducibility
  • ⚡ GPU-Native: WebCodecs (VideoEncoder) for hardware-accelerated encoding
  • 🎵 Audio-Reactive: FFT-analyzed audio drives visual animations
  • 📦 Modular Exports: @johnesleyer/clawmotion/core, client, server, blueprints
  • 🎞️ Fast Rendering: Skia Canvas + FFmpeg for server-side production

📋 Requirements

# Ubuntu/Debian
sudo apt-get install -y ffmpeg
  • FFmpeg: Video encoding (included in server pipeline)

🚀 Quick Start

Installation

npm install @johnesleyer/clawmotion
npm run build

Use in Node.js

import { ClawEngine, Clip } from '@johnesleyer/clawmotion/core';
import { MotionFactory } from '@johnesleyer/clawmotion/server';
import { ProBlueprints } from '@johnesleyer/clawmotion/blueprints';

const config = {
    width: 1280,
    height: 720,
    fps: 30,
    duration: 5
};

const clips: Clip[] = [
    {
        id: 'my-clip',
        blueprintId: 'gradient-bg',  // Built-in blueprint
        startTick: 0,
        durationTicks: 150,
        props: { color1: '#1a2a6c', color2: '#b21f1f' }
    }
];

const factory = new MotionFactory();
await factory.render(config, clips, './output.mp4');

Run Examples

npx ts-node examples/hello-world.ts
npx ts-node examples/transitions.ts
npx ts-node examples/keyframes.ts

ClawStudio (Visual Editor)

# From any folder - that folder becomes your workspace
clawmotion studio

# Or with explicit workspace
CLAWMOTION_WORKSPACE=/path/to/folder npm run studio

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        ClawMotion                                │
├───────────────────────┬─────────────────────────────────────────┤
│    Browser (Preview)  │           Server (Node.js)              │
├───────────────────────┼─────────────────────────────────────────┤
│  • ClawEngine         │  • MotionFactory                        │
│  • ClawPlayer        │  • Skia Canvas                          │
│  • OffscreenCanvas   │  • FFmpeg Pipeline                     │
│  • VideoEncoder      │  • Fast rendering                       │
│  (100% parity)       │                                         │
└───────────────────────┴─────────────────────────────────────────┘
                          │
                   Shared Core
          (Blueprints, Math, Animator)

Render Modes

| Mode | Parity | Speed | Use Case | |------|--------|-------|----------| | Browser (WebCodecs) | 100% | Fast | Production, exact replica | | Server (Skia) | ~99% | Fastest | Quick previews |


🎨 The Blueprint Pattern

Blueprints are pure functions that define "how" to draw:

import { BlueprintContext } from '@johnesleyer/clawmotion/core';

export const NeonPulse = (ctx: BlueprintContext) => {
    const { width, height, localTime, props, utils } = ctx;
    
    const jitter = utils.range(-5, 5);  // Deterministic
    
    ctx.ctx.fillStyle = props.color || 'cyan';
    ctx.ctx.fillRect(width/2 - 50 + jitter, height/2 - 50, 100, 100);
};

Built-in Blueprints

  • gradient-bg - Animated gradient backgrounds
  • text-hero - Premium typography
  • floaty-blobs - Deterministic particles
  • glass-card - Glassmorphism UI
  • vignette - Cinematic corners
  • video - Video overlays

📜 Clip Definition

const clip = {
    id: 'my-clip',
    blueprintId: 'gradient-bg',
    startTick: 0,
    durationTicks: 150,
    props: { color1: '#1a2a6c', color2: '#b21f1f' },
    entry: { type: 'fade', durationTicks: 30 },
    exit: { type: 'zoom', durationTicks: 30 },
    layer: 0,
    blendMode: 'normal'
};

Transitions

Built-in transitions: fade, slide, zoom

Animations

const clip = {
    // ...
    animations: {
        x: [
            { tick: 0, value: 0, easing: 'easeOutQuad' },
            { tick: 60, value: 500 }
        ],
        opacity: [
            { tick: 0, value: 0 },
            { tick: 30, value: 1 }
        ]
    }
};

🛠️ Tech Stack

  • TypeScript - Type-safe core
  • OffscreenCanvas - Browser rendering
  • WebCodecs - Hardware-accelerated encoding
  • Skia Canvas - Node.js rendering
  • FFmpeg - Video encoding
  • esbuild - Fast bundling

📁 Project Structure

clawmotion/
├── src/
│   ├── core/          # Engine, Math, Animator, Blueprint types
│   ├── client/         # Player, Compositor, WebCodecs encoder
│   ├── server/         # Factory, NodeEncoder, FFmpeg
│   ├── blueprints/     # ProBlueprints library
│   └── cli/            # clawmotion CLI
├── examples/           # Usage examples
└── studio/             # ClawStudio visual editor

🤖 AI Integration

See LLM.md for AI agent context, code snippets, and best practices.


⚖️ License

ISC License. See LICENSE file.