npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iadev93/zuno-elysia

v0.0.13

Published

<p><b>Elysia adapter for Zuno.</b></p>

Readme

@iadev93/zuno-elysia

Provides seamless state synchronization for ElysiaJS (Bun) applications using native async generators.


pnpm add @iadev93/zuno-elysia

Usage

import { Elysia } from 'elysia'
import { cors } from '@elysiajs/cors'
import { createZunoElysia } from '@iadev93/zuno-elysia'
import { createZunoServerState } from '@iadev93/zuno/server'

const app = new Elysia()
  .use(cors())
  
const server = createZunoServerState()
const zuno = createZunoElysia({
  server,
  authorize: ({ request, action }) => {
    // Replace with your session, API-key, or tenant policy.
    return canAccessZuno(request, action)
  },
})

// Register Zuno handlers
app.get('/zuno/sse', zuno.sse)
app.post('/zuno/sync', zuno.sync)
app.get('/zuno/snapshot', zuno.snapshot)

app.listen(3002)

API

createZunoElysia(options?)

Returns an object containing the following handlers:

Each call creates isolated server state by default. Pass server when several handlers or custom endpoints must share one authoritative universe. The returned object exposes the selected instance as zuno.server.

The optional authorize hook runs before SSE/snapshot reads and mutation writes. Returning false produces a 403 FORBIDDEN response without reading or mutating server state.

sse (GET)

An async generator handler for Server-Sent Events. It automatically handles:

  • Connection keep-alive and heartbeats.
  • Reconnection logic via last-event-id.
  • Initial state snapshots for fresh connections.
  • Retained-event replay after short interruptions.
  • Authoritative snapshot fallback when the requested replay range has expired.
  • Bounded per-subscriber buffering through the selected server state's maxSubscriberBuffer option.

sync (POST)

Validates and applies incoming state events to the Zuno universe. Handles version conflicts and broadcasts updates to all connected SSE clients.

snapshot (GET)

Returns the current full state of the universe, the current version, and the last event ID.

Features

  • Native SSE: Uses Elysia's optimized streaming capabilities with async generators.
  • Resilient Recovery: Replays missed events when retained and falls back to an event-ID-bearing snapshot after a replay gap.
  • Backpressure Protection: Disconnects subscribers that exceed the configured pending-message buffer so they can recover cleanly on reconnect.
  • Lightweight: Zero runtime dependencies on Elysia itself (uses structural typing).
  • Type Safe: Fully written in TypeScript with comprehensive docstrings.

License

MIT