Tiny·Engine (Core)

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:

index.html
<script src="https://unpkg.com/tiny-engine-core"></script>

From a package manager

Pick your favourite — they're all equivalent.

npm

Then import what you need:

src/main.ts
import { UI, Capsule, CapsuleStore } from "tiny-engine-core";
index.html
<script src="https://unpkg.com/tiny-engine-core/dist/tiny-engine.min.js"></script>
<script>
  const { UI } = window;
  // your capsules
</script>
index.html
<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.

index.html
<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:

legacy.html
<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.