@vosjs/core
v0.7.0
Published
Programmatic video engine for the web — compile a declarative config into deterministic, resolution-independent motion graphics and video (Three.js, GSAP, 2D, HTML, video). The open engine behind vos.so.
Maintainers
Readme
@vosjs/core
The vos engine — turn a function into deterministic, resolution-independent, mixed-media video. Compiler, schema, runtime, and addon registry.
Part of vos, the open visual operating system that powers vosso.
A video is just inputs and a function, rendered. @vosjs/core takes a JSON description of an animation — scenes, cameras, post-processing, GSAP timelines, and overlay elements — and compiles it into a self-contained template that renders identically every time. The core is pure (no DOM dependencies), so it runs in the browser, in Node, or in a Cloudflare Worker for server-side rendering.
Install
pnpm add @vosjs/core three gsapthree and gsap are optional peer dependencies — you bring your own versions, and the engine never bundles them.
Quick start
import { compileVosConfig, vosConfigJsonSchema } from '@vosjs/core'
const config = {
version: 2,
duration: 3,
camera: { preset: 'perspective' },
// functions are authored as strings, compiled into executable code
createContent:
'(ctx) => { const { THREE, scene } = ctx; const m = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshBasicMaterial()); scene.add(m); return { m } }',
createTimeline:
'(ctx, content, duration) => ctx.gsap.timeline().to(content.m.rotation, { y: Math.PI, duration })',
}
vosConfigJsonSchema.parse(config) // validate
const template = compileVosConfig(config) // → runnable template stringThe compiled template is an HTML/JS document you can render in an iframe, capture to video, or snapshot to an image.
Subpath exports
| Import | What it gives you |
| --- | --- |
| @vosjs/core | compileVosConfig, schemas, addon registry, types |
| @vosjs/core/compiler | The compiler and code generators |
| @vosjs/core/runtime | generateRenderTemplate, transformModuleCode, render limits |
| @vosjs/core/schema | Zod schemas, validators, config migrations |
| @vosjs/core/addons | Three.js addon / post-processing registry |
| @vosjs/core/extract | Config extraction from LLM/text output |
| @vosjs/core/types | Pure type definitions |
License
MIT © vosso
