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

@nats-io/nst

v3.4.0

Published

Internal test helpers for nats.js — not a supported public API

Readme

@nats-io/nst

Status: internal/unsupported. @nats-io/nst exists to support tests within the nats.js repo. It is published so the test suite can install it like any other workspace member, but it is not a stable public API. Symbols, behavior, and signatures may change without notice. Do not depend on it outside this repo without expecting churn.

Shared test utilities for nats.js modules. Provides:

  • NatsServer — spawns/manages a nats-server binary for tests (single, cluster, leafnode).
  • setup / cleanup — quick test fixtures returning a server + connection.
  • jetstreamServerConf / jetstreamExportServerConf / wsServerConf — config builders.
  • Lock, check, assertBetween, flakyTest — small test helpers.
  • Connection, TestServer — fake-NATS TCP server for protocol tests.
  • registerConnect / getConnect — transport injection (see below).

Runs on Deno and Node.js (≥ 20). The package never imports a transport — the caller registers connect from their transport package.

Requirements

  • nats-server binary on PATH. Install: https://github.com/nats-io/nats-server/releases
  • Node.js ≥ 20 or Deno ≥ 2.

Install

# npm
npm i -D @nats-io/nst

# JSR / Deno
deno add jsr:@nats-io/nst

@nats-io/nats-core is a peer dependency — your project provides it.

Bootstrap

@nats-io/nst does not import a transport. Each test runtime must register one once before calling setup() or NatsServer.connect():

Deno (transport-deno)

// tests/connect.ts
import { connect } from "@nats-io/transport-deno";
import { registerConnect } from "@nats-io/nst";
registerConnect(connect);
export { connect };

Node.js (transport-node)

// tests/connect.js
const { connect } = require("@nats-io/transport-node");
const { registerConnect } = require("@nats-io/nst");
registerConnect(connect);
module.exports = { connect };

Tests then import setup, cleanup, NatsServer, etc. from @nats-io/nst and the registered connect is used internally.

Example

import { cleanup, jetstreamServerConf, setup } from "@nats-io/nst";
import "./connect.ts";

Deno.test("publish/subscribe", async () => {
  const { ns, nc } = await setup(jetstreamServerConf());
  // ... use nc ...
  await cleanup(ns, nc);
});

Cluster / leafnode

const cluster = await NatsServer.cluster(3);
// ...
await NatsServer.stopAll(cluster, true);

NatsServer exposes varz(), jsz(), connz(), leafz() for monitoring endpoint queries.

License

Apache 2.0