Getting started
Installation
tiny-engine-core ships as ESM, IIFE, and CommonJS. Pick the delivery method that fits your project.
From a CDN
Add the following script tag to your HTML:
<script src="https://unpkg.com/tiny-engine-core"></script>From a package manager
Pick your favourite — they're all equivalent.
Then import what you need:
import { UI, Capsule, CapsuleStore } from "tiny-engine-core";<script src="https://unpkg.com/tiny-engine-core/dist/tiny-engine.min.js"></script>
<script>
const { UI } = window;
// your capsules
</script><script type="module">
import { UI, Capsule } from "https://unpkg.com/tiny-engine-core";
// your capsules
</script>From a CDN (ESM)
Drop a single script tag into any HTML page. No build step, no bundler.
<script type="module">
import { UI, Capsule } from "https://unpkg.com/tiny-engine-core";
// your capsules
</script>From a CDN (IIFE)
If you can't use ESM yet (legacy environments, no module support), the IIFE bundle exposes window.UI:
<script src="https://unpkg.com/tiny-engine-core/dist/tiny-engine.min.js"></script>
<script>
const { UI } = window;
// your capsules
</script>What gets bundled?
tiny-engine-core is fully tree-shakable. If you only import { UI } you get only the engine; the Capsule base class and CapsuleStore live in separate exports so your final bundle never carries dead code.