µ MicroDOM ecosystem
Stable v1.1.0 Zero dependencies

Mode.js

A tiny DOM manipulation library. Simple DOM operations, events and templating helpers — exposed through one minimal, chainable API written on the global µ.

Install View on GitHub

What Mode.js gives you

Simple DOM ops

Select, read and update elements through one consistent call.

Events

Attach and reason about interaction without ceremony.

Templating helpers

Compose markup with small, readable helpers.

Minimal API

One entry point. A surface you can hold in your head.

Dependency free

No runtime dependencies. The core is a single tiny file.

No build step

Drop in a <script> tag or import from a CDN.

Install

Zero dependencies. Mode.js ships with no runtime dependencies — the whole core is a single tiny file.

terminal

npm install @microdom/mode

Builds

Each entry point ships in three formats — pick the one that matches how you load it.

FileFormatLoad with
dist/mode.jsESMimport (bundlers, <script type="module">)
dist/mode.esm.min.jsESM, minifiedimport for the smallest module build
dist/mode.min.jsIIFEclassic <script> — exposes the global µ

An IIFE build has no exports, so it can't be imported — use an ESM build for import, and the IIFE for a plain <script>.

Usage

Bundler / npm

Resolves to the ESM build:

app.js

import µ from "@microdom/mode"
// or: import { µ } from "@microdom/mode"

Browser — classic script

Global µ, no build step:

index.html

<script src="https://cdn.jsdelivr.net/gh/microdom/mode.js@v1.1.0/dist/mode.min.js"></script>
<script>
  µ("body", { /* ... */ })
</script>

Browser — native ES module

index.html

<script type="module">
  import µ from "https://cdn.jsdelivr.net/gh/microdom/mode.js@v1.1.0/dist/mode.js"
  µ("body", { /* ... */ })
</script>

Optional extension

MoveDOM — animation extension

Animations live in a separate, optional extension so the core stays tiny. Load it and Mode gains slide / fade / animate / show / hide commands plus the offset / pos getters — all chained through the same µ(...) call.

movedom.js

µ("#panel", { slideUp: { t: 300 } })
µ("#panel", { fadeIn:  { t: 200, fn: () => console.log("done") } })
µ("#box",   { animate: { props: { width: 400 }, t: 500, easing: "easeOut" } })
µ("#box",   { stop: {} })            // cancel running animation
const off = µ("#box", { offset: null }) // → { top, left }

If an interaction cannot be expressed simply, the abstraction is probably wrong.

Get it on npm See the whole ecosystem