jsCargo documentation
A modular toolchain for packaging media: schema, transcoding, storage adapters, and lightweight app helpers. The source of truth lives in the repo on GitHub. For updates, check https://github.com/jsCargo-net/jscargo.
Packages
| Package | Status | Purpose |
|---|---|---|
| @jscargo/schema | verifiedstable | Canonical JSON Schema for media metadata and extensions. |
| @jscargo/transcoder | verifiedWIP | CLI for HLS/DASH outputs + schema-compliant metadata. |
| @jscargo/storage | verifiedplanned | S3/R2/local adapters; rewrites URLs into metadata. |
| @jscargo/api | verifiedplanned | App helpers to read/validate metadata; HLS.js/dash.js wiring. |
| @jscargo/hooks | verifiedplanned | React hooks for HLS.js wiring, etc. |
| @jscargo/cli | verifiedplanned | One-shot: transcode → upload → emit metadata. |
Install
Pick your package manager and install the schema and Ajv:
Bun
bun add @jscargo/schema ajvnpm
npm install @jscargo/schema ajvYarn
yarn add @jscargo/schema ajvpnpm
pnpm add @jscargo/schema ajvValidate schema with Ajv
Minimal example using the core schema:
import coreSchema from '@jscargo/schema';
import Ajv from 'ajv';
const ajv = new Ajv();
const validate = ajv.compile( coreSchema );
const example = {
version: '1.0',
metadata: { title: 'Example Video' },
sources: []
};
console.log( validate( example ) ); // true/false
if ( validate.errors?.length > 0 ) {
console.log( validate.errors );
}Next steps
- Transcoder CLI (WIP): emit HLS/DASH + metadata JSON.
- Storage adapters (planned): upload to S3/R2/local and rewrite URLs.
- API helpers (planned): validate metadata in apps and wire to HLS.js/dash.js.