Send HTML that renders instantly, then fills itself in as async tasks complete. One response. No hydration. No empty shells.
This monorepo hosts the JavaScript implementation of HTMS: a proposal to progressively render HTML with async functions while staying SEO-friendly and lightweight.
This workspace contains multiple packages:
- htms-js β Core library to tokenize, resolve, and stream HTML.
- htms-dom β Core browser library to swap and clean placeholders.
- fastify-htms β Fastify plugin that wires
htms-jsinto Fastify routes. - htms-server β CLI to quickly spin up a server and test streaming HTML.
Each package has its own README with installation and usage instructions.
π¦ Rustacean? Check out htms-rs.
- Instant rendering: browsers show HTML immediately.
- Progressive async: placeholders stream in as soon as ready.
- Scoped modules: keep tasks organized by context, even with nested
data-htms-moduleblocks. - SEO intact: bots see full HTML.
- Tiny runtime: one Web Component, injected automatically.
- Tech-agnostic: works with Express, Fastify, Hono, workers, or even raw
stdout.
- Tokenizer: scans HTML for
data-htms. - Resolver: maps names to async functions.
- Serializer: streams HTML and emits chunks as tasks finish.
- Client runtime: swaps placeholders and cleans up markers.
Result: SEO-friendly streaming HTML with minimal overhead.
$ curl -N https://htms.skarab42.dev/curlThis is experimental. APIs may change.
We'd love developers to:
- Experiment in different contexts.
- Find limits: performance, DX, compatibility.
- Challenge assumptions and suggest alternatives.
- See if it fits your framework or stack.
Setup
git clone https://github.com/skarab42/htms-js.git
cd htms-js
pnpm i
pnpm buildCommon dev commands
# format + lint + typecheck + build + test
pnpm check
# run tests
pnpm test
pnpm test:watch
# lint / format
pnpm lint:check
pnpm lint:fix
pnpm format:check
pnpm format:write
# code coverage
pnpm coverage
# build all packages
pnpm buildRun examples
# run from repo root, pick one:
pnpm --filter server-example start # published dashboard demo at https://htms.skarab42.dev
pnpm --filter hono-example start
pnpm --filter fastify-example start
pnpm --filter express-example start
pnpm --filter stdout-example startReset workspace
pnpm resetHelp explore whether streaming HTML can be practical:
- β Star the repo
- π Report issues
- π‘ Propose ideas
- π Open PRs
The only way to know where this works or breaks is to try it together.
MIT

