tiny-engine-core is a lightweight JavaScript engine for building declarative HTML capsules - class-based or functional, with a lifecycle-aware runtime, scoped scan and explicit destroy APIs, a global event bus, devtools snapshots, plugins, and a reducer-style store.
Define a capsule, register it, then sprinkle ui-counter on any element. tiny-engine wires up refs, props, listeners, and devtools snapshots - no build step required.
1.6.0
current release
0
runtime deps
import { UI, Capsule } from "tiny-engine-core";
class Counter extends Capsule {
constructor(el, options) {
super(el, options);
this.count = 0;
this.on(this.refs.inc, "click", () => {
this.count++;
this.refs.label.textContent = this.count;
});
}
}
UI.register("counter", Counter);
UI.init();A small runtime surface, now with better inspection and extension hooks.
A small zero-dependency runtime. No virtual DOM, no compiler, no framework lock-in.
Register a Capsule class or a functional capsule. Each owns its element, refs, props, events, and cleanup.
Mount from ui-* attributes, drive public methods with data-ui-toggle triggers, and use @directives where they fit.
UI.devtools() and window.__TINY_ENGINE__ expose config, registry, capsules, stores, plugins, warnings, and events.
CapsuleStore uses send/connect plus middleware that can log, transform, or cancel actions.
Install extensions with UI.use(plugin), subscribe to lifecycle hooks, expose helpers, and add diagnostics.
UI.config({ debug, warnings }) gives clearer development-time logging without changing production behavior.
Mount inside React, Vue, Astro, Svelte - or stand alone. tiny-engine plays nice.
tiny-engine-core fits local npm workflows out of the box. Follow the quick-start and you'll have your first capsule live in under five minutes.