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

@liveflux/sse

v0.1.0

Published

Server-Sent Events (SSE) adapter for Liveflux — an EventSource stream with reconnect and cursor resume, for any backend in any language.

Readme

@liveflux/sse

The Server-Sent Events adapter for Liveflux — works with any backend that exposes an SSE endpoint, in any language. Turns a standard EventSource into a normalized, reconnect-safe event stream for @liveflux/core.

New to Liveflux? Start with pnpm create liveflux@latest — it picks your framework binding and transport and wires everything up for you.

  • Backend-agnostic. The downstream stream is a plain EventSource; bring your own encode/decode.
  • Zero runtime dependencies, tree-shakeable, tiny.
  • Reconnect-safe. The core owns reconnect (one backoff policy, not the browser's opaque retry); the active subscription set is replayed on every reopen.
  • Cursor resume. resume(subId, cursor) sends a gap-recovery frame, and the default decoder threads the SSE lastEventId through as the cursor.
  • Configurable & secure by default. Injectable EventSource/fetch, an inbound size cap, and a decoder that only accepts well-formed events.

Why a control channel?

SSE is one-way (server → client). Subscribe / unsubscribe / resume therefore go upstream over a separate channel — by default an HTTP POST alongside the stream (override with control, or hand it your own transport function).

import { LivefluxClient } from '@liveflux/core';
import { sse } from '@liveflux/sse';

const client = new LivefluxClient({
  adapter: sse('/events', { control: '/events/control' }),
});
client.connect();

Options

| Option | Description | | --- | --- | | control | Upstream target for subscribe/unsubscribe/resume: a URL (POSTed as JSON), a function (your own transport), or omitted (POST to the stream URL). | | withCredentials | Send cookies with the stream request. | | EventSource | Inject an EventSource implementation (Node / tests). | | fetch | Inject fetch for the default control POST. | | encode / decode | Override the control-frame encoder and the inbound decoder. | | maxMessageBytes | Drop inbound frames larger than this before decoding (default 1 MiB; 0 disables). |

Pass url as a function to re-resolve it (e.g. a rotated token) on every reconnect.

License

MIT