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

@novominteractive/ase-transport-nats

v1.0.0-rc.2

Published

NATS transport for [`@novominteractive/anyware-stateless-client`](https://www.npmjs.com/package/@novominteractive/anyware-stateless-client). Supports browser WebSocket connections and Node.js TCP connections.

Readme

@novominteractive/ase-transport-nats

NATS transport for @novominteractive/anyware-stateless-client. Supports browser WebSocket connections and Node.js TCP connections.

Installation

yarn add @novominteractive/anyware-stateless-client @novominteractive/ase-transport-nats

For Node.js TCP connections, also install the Node transport:

yarn add @nats-io/transport-node

Peer dependencies

| Package | Required | Notes | |---------|----------|-------| | @novominteractive/anyware-stateless-client | Yes | Core client | | @nats-io/transport-node | No | Only needed for TCP connections in Node.js |

Usage

Browser / Node.js via WebSocket

Point servers at the WebSocket port of your NATS server (typically 4221).

import ASEClient from '@novominteractive/anyware-stateless-client';
import { NatsTransport } from '@novominteractive/ase-transport-nats';

const client = new ASEClient({
  licenseKey: 'your-license-key',
  rootTopic: 'myProject/production',
  transport: new NatsTransport({ servers: 'ws://your-nats-server:4221' }),
});

await client.connect(credsToken);

Node.js via TCP

For server-side code, inject connect from @nats-io/transport-node and use a nats:// URL (TCP port, typically 4222). This avoids the WebSocket overhead and works on Node.js 20+.

import { connect } from '@nats-io/transport-node';
import ASEClient from '@novominteractive/anyware-stateless-client';
import { NatsTransport } from '@novominteractive/ase-transport-nats';

const client = new ASEClient({
  licenseKey: 'your-license-key',
  rootTopic: 'myProject/production',
  transport: new NatsTransport({
    servers: 'nats://your-nats-server:4222',
    connect,
  }),
});

Token format

The NATS transport expects a .creds string — a NATS User JWT bundled with its NKey seed. Use signNatsToken from @novominteractive/anyware-server-auth to issue one server-side:

import { signASEToken } from '@novominteractive/anyware-server-auth';

const token = await signASEToken({
  transport: 'nats',
  payload: {
    subscribeTopics: ['myProject/events'],
    publishTopics:   ['myProject/commands'],
    ttlSeconds: 3600,
  },
  config: {
    signingKeySeed:   process.env.NATS_SIGNING_SEED!,
    accountPublicKey: process.env.NATS_ACCOUNT_PUBLIC_KEY!,
    licenseKey: 'your-license-key',
  },
});

The signing seed and account public key come from the license bundle issued by Novom Interactive.

Configuration

interface NatsTransportConfig {
  /**
   * NATS server URL or array of URLs.
   * - WebSocket (browser / Node.js): `ws://host:4221` or `wss://host:4221`
   * - TCP (Node.js only, requires `connect` from @nats-io/transport-node): `nats://host:4222`
   */
  servers: string | string[];
  /**
   * Optional TCP connect function for Node.js.
   * Pass `connect` from `@nats-io/transport-node` together with a `nats://` URL.
   * When omitted, `wsconnect` from `@nats-io/nats-core` is used.
   */
  connect?: NatsConnectFn;
}

NATS server requirements

The NATS server must be configured with:

  • A full JWT resolver (accounts and operator)
  • A WebSocket listener if clients connect via ws:// or wss://