https://github.com/skarab42/htms-js
HTMS 💨 Stream Async HTML, Stay SEO-Friendly
https://github.com/skarab42/htms-js
async express fastify hono html nodejs seo stream
Last synced: 19 days ago
JSON representation
HTMS 💨 Stream Async HTML, Stay SEO-Friendly
- Host: GitHub
- URL: https://github.com/skarab42/htms-js
- Owner: skarab42
- License: mit
- Created: 2025-09-09T04:37:21.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2025-09-17T14:55:42.000Z (21 days ago)
- Last Synced: 2025-09-17T16:48:33.489Z (21 days ago)
- Topics: async, express, fastify, hono, html, nodejs, seo, stream
- Language: TypeScript
- Homepage: https://htms.skarab42.dev
- Size: 6.06 MB
- Stars: 16
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# htms 💨 Stream Async HTML, Stay SEO-Friendly
[](./packages/htms-js)
[](./packages/fastify-htms)
[](./packages/htms-server)
[](https://github.com/skarab42/htms-js/actions)
[](https://codecov.io/github/skarab42/htms-js)
[](./license.md)
[](https://github.com/skarab42/htms-js/stargazers)> 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.
---
## Packages
This workspace contains multiple packages:
- [**htms-js**](./packages/htms-js) – Core library to tokenize, resolve, and stream HTML.
- [**fastify-htms**](./packages/fastify-htms) – Fastify plugin that wires `htms-js` into Fastify routes.
- [**htms-server**](./packages/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**](https://github.com/skarab42/htms-rs).
---
## Why try it
- **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-module` blocks.
- **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`.---
## How it works
1. **Tokenizer:** scans HTML for `data-htms`.
2. **Resolver:** maps names to async functions.
3. **Serializer:** streams HTML and emits chunks as tasks finish.
4. **Client runtime:** swaps placeholders and cleans up markers.Result: **SEO-friendly streaming HTML** with minimal overhead.
### Try the `curl` optimized demo
```bash
$ curl -N https://htms.skarab42.dev/curl
```[](https://htms.skarab42.dev/curl)
### Try the (too much) dashboard demo
[](https://htms.skarab42.dev/)
---
## Status
This 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.**---
## Contribute
Help explore whether streaming HTML can be practical:
- ⭐ [Star the repo](https://github.com/skarab42/htms-js)
- 🐛 [Report issues](https://github.com/skarab42/htms-js/issues)
- 💡 [Propose ideas](https://github.com/skarab42/htms-js/discussions)
- 🙏 [Open PRs](https://github.com/skarab42/htms-js/pulls)The only way to know where this works or breaks is to **try it together**.
---
## License
MIT