SUBSCRIBE
v0.1.0 — route.subscribe() primitive — projects to SSE, MCP resource notifications, tRPC subscriptions.
$ hyper add subscribe
Copies 1 file into src/hyper/subscribe/ and updates hyper.lock.json.
DEPS
- registry: core
FILES
- subscribe/index.ts
README
@hyper/subscribe
subscribe() primitive — projects to SSE, MCP resource notifications, tRPC subscriptions.
Install
Components are installed as source into your repo, not pulled from npm:
bunx hyper add subscribe
Wires the alias @hyper/subscribe to src/hyper/subscribe/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.
Usage
import { Hyper } from "@hyper/core"
import { subscribe } from "@hyper/subscribe"
export default new Hyper()
.use(
subscribe("/events", async function* () {
yield { data: { type: "tick", at: Date.now() } }
}),
)
.listen(3000)
Docs
See the main README and docs/ for guides and integration recipes.
License
MIT
MANIFEST
- /r/subscribe.json — latest
- /r/subscribe@0.1.0.json — immutable