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

@appweaver/realtime

v2.10.0

Published

Appweaver - the backend framework for AI-first development (@realtime)

Readme

Description

@appweaver/realtime pushes events to the clients of an Appweaver API over a WebSocket or Server-Sent Events, a module enabled by installing it (it requires @appweaver/web). The clients subscribe to:

  • the channels of the application and of the modules, created with createChannel
  • the resource events (create, update, delete) of the models exposing them with createRoutes({ events })

and call the custom actions of createRealtimeAction over the WebSocket, waiting for the result or fire-and-forget. The streams carry chunks rather than events, i.e. the tokens of an LLM answer: a streaming action streams its chunks to its caller, and createStream to the subscribers of a key, each subscriber checked once and never per chunk. An action with an input receives the chunks a client streams over the WebSocket, i.e. the audio of a microphone. A stream bound to a resource lets subscribe the users the policy of its model lets read the record, and a logout, a disabling or a lost role ends the calls of a user at once. Nothing is exposed unless declared, and every event is checked against the access of the subscribed user: the callbacks of the channel, or the events callback of the resource policy, else its checkAccess and readRestrictions. With @appweaver/redis the events reach the connections of every instance through the Redis pub/sub.

Installation

npm install @appweaver/realtime

or weaver module add realtime in a project created with @appweaver/create.

Usage

import { Type } from '@sinclair/typebox';
import { createChannel, createRealtimeAction } from '@appweaver/realtime';

export const orderShipped = createChannel({
  name: 'order.shipped',
  payload: Type.Object({ orderId: Type.Integer(), customerId: Type.Integer() }),
  deliver: (user, payload) => payload.customerId === user?.id
});

createRealtimeAction({
  name: 'chat.typing',
  payload: Type.Object({ roomId: Type.Integer() }),
  handler: async ({ roomId }, { user }) =>
    typing.publish({ roomId, userId: user!.id })
});

await orderShipped.publish({ orderId: 7, customerId: 1 });

createRealtimeAction({
  name: 'assistant.prompt',
  payload: Type.Object({ prompt: Type.String() }),
  stream: { codec: 'text', coalesce: 16 },
  async *handler({ prompt }, { signal }) {
    for await (const token of llm.stream(prompt, { signal })) yield token;
  }
});

The client generated by weaver-client generate connects with a ticket of POST /api/realtime/ticket:

client.realtime.subscribe('order.shipped', (payload) => console.log(payload));
client.realtime.on('Order', (event) =>
  console.log(event.action, event.current)
);
await client.realtime.send('chat.typing', { roomId: 1 });

for await (const token of client.realtime.call('assistant.prompt', { prompt })) {
  output += token;
}

See the realtime reference for the protocol, the config and the limits.

License

Appweaver is MIT licensed.