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

@sansavision/pulse-node

v0.1.0

Published

Framework-agnostic native Node.js bindings for the Pulse protocol engine (QUIC relay, SFU, RPC, message queue).

Downloads

10

Readme

@sansavision/pulse-node

Framework-agnostic native Node.js bindings for the Pulse protocol engine.

Embeds the full Rust Tokio runtime as a native C-ABI addon (.node), allowing any Node.js process to run a high-performance Pulse relay, RPC server, SFU, or message queue — directly inside the same OS process, without Docker or Kubernetes.

Supported Frameworks

This is not tied to any specific framework. It works with:

  • Next.js (custom server mode via node server.js)
  • Remix (Express/Fastify adapter)
  • SvelteKit (Node adapter)
  • NestJS, Fastify, Express, Hono, Koa
  • TanStack Start (Vinxi adapter)
  • Plain node app.js

Installation

npm install @sansavision/pulse-node

Quick Start

const { PulseRelay, PulseRoom, PulseCodec, pulseVersion } = require('@sansavision/pulse-node');

// Start an embedded relay on port 4001
const relay = new PulseRelay({ bind: '0.0.0.0:4001', region: 'us-east-1' });
await relay.start();

// Create an SFU room for real-time media routing
const room = new PulseRoom('my-room');
await room.addParticipant('alice');
await room.addParticipant('bob');
await room.subscribe('bob', 'audio');

console.log(`Pulse v${pulseVersion()} relay running with ${await room.participantCount()} participants`);

API Reference

PulseRelay

Embedded QUIC + WebSocket relay server.

const relay = new PulseRelay({
  bind: '0.0.0.0:4001',      // TCP/UDP bind address
  region: 'eu-west-1',        // Region for service discovery
  controlUrl: 'http://...',   // Control plane URL (optional)
  capacity: 100000,           // Max concurrent connections
  maxPayloadBytes: 1048576,   // Max PLP packet size (1 MiB)
  enableWebsocket: true,      // WebSocket gateway for browsers
});

const info = await relay.start();   // Start listening (non-blocking)
await relay.isRunning();            // Check status
await relay.stop();                 // Graceful shutdown

PulseRoom

In-process Selective Forwarding Unit (SFU) for media routing.

const room = new PulseRoom('call-123');
await room.addParticipant('alice');
await room.subscribe('alice', 'video-stream');
await room.participantCount();       // => 1
await room.removeParticipant('alice');

PulseRpc

In-process RPC server using the Pulse RPC protocol.

const rpc = new PulseRpc();
await rpc.register('user.getProfile');
await rpc.register('billing.createInvoice');
const methods = await rpc.methods(); // => ['user.getProfile', 'billing.createInvoice']

PulseQueue

In-process durable message queue with at-least-once delivery.

const queue = new PulseQueue('notifications');
const seq = await queue.enqueue(Buffer.from('Hello'));
const msg = await queue.dequeue();   // => Buffer('Hello')
const depth = await queue.depth();   // => 0

PulseCodec

Low-level PLP binary packet encoder/decoder.

const codec = new PulseCodec();

// Encode: packetType (0x05=StreamData), streamId, sequence, payload
const encoded = codec.encode(0x05, 42, 100, Buffer.from('data'));

// Decode
const { packetType, streamId, sequence, payload } = codec.decode(encoded);

Utility Functions

pulseVersion(); // => '0.1.0'
plpVersion();   // => 1

Architecture

┌─────────────────────────────────────────────────┐
│              Node.js Process                     │
│                                                  │
│  ┌──────────────┐    ┌───────────────────────┐  │
│  │   V8 Engine   │    │  Rust Tokio Runtime   │  │
│  │  (Your App)   │    │  (Pulse Engine)       │  │
│  │               │    │                       │  │
│  │  Express/     │◄──►│  QUIC Server          │  │
│  │  Next.js/     │    │  WebSocket Gateway    │  │
│  │  Remix/       │    │  SFU Packet Router    │  │
│  │  SvelteKit    │    │  RPC Dispatcher       │  │
│  │  etc.         │    │  Message Queue        │  │
│  │               │    │  PLP Codec            │  │
│  └──────────────┘    └───────────────────────┘  │
│        libuv              tokio threads          │
└─────────────────────────────────────────────────┘

The Rust Tokio runtime runs on dedicated OS threads, completely independent of Node's single-threaded libuv event loop. This means:

  • Zero event-loop blockingsetTimeout, setInterval, and async I/O work exactly as expected
  • Native performance — compiled Rust, not interpreted JavaScript
  • Shared memory — no IPC overhead between your app and the relay engine

PLP Packet Types

| Value | Name | Description | |-------|------|-------------| | 0x01 | Connect | Client connection request | | 0x02 | Accept | Server connection acceptance | | 0x03 | Reject | Server connection rejection | | 0x04 | StreamOpen | Open a new stream | | 0x05 | StreamData | Stream data payload | | 0x06 | StreamClose | Graceful stream close | | 0x07 | StreamReset | Abrupt stream reset | | 0x08 | Ping | Keepalive ping | | 0x09 | Pong | Keepalive pong | | 0x0A | Metrics | Telemetry metrics | | 0x0B | Migrate | Connection migration | | 0x0C | MigrateAck | Migration acknowledgment | | 0x0D | RelayForward | Relay-to-relay forwarding | | 0x0E | Priority | Stream priority update | | 0x0F | GoAway | Graceful shutdown signal |

License

MIT