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

@nostrwatch/auditor

v0.0.1

Published

Nostr relay auditor — runs NIP conformance tests against any relay.

Readme

@nostrwatch/auditor

Nostr relay auditor — runs NIP conformance tests against any relay.

npm version License Status Runtime

Overview

@nostrwatch/auditor tests Nostr relays (WebSocket servers that store and forward signed events) for protocol conformance. Given a relay URL, it runs a battery of NIP (Nostr Implementation Possibility — numbered protocol specifications) test suites and returns a structured result indicating which NIPs the relay supports correctly. Use it to benchmark new relays, validate relay upgrades, or power relay-health dashboards.

Auditor is a library — it runs tests but does not store results. Pair it with @nostrwatch/route66 for persistent relay monitoring or @nostrwatch/nocap for low-level relay connection checks.

Installation

pnpm add @nostrwatch/auditor

Or with npm:

npm install @nostrwatch/auditor

Quick Start

import {Auditor} from '@nostrwatch/auditor'

const auditor = new Auditor({nips: new Set(['Nip01', 'Nip11'])})
await auditor.detectSupportedNips('wss://relay.damus.io')
const result = await auditor.test('wss://relay.damus.io')
console.log(result)
// { relay: 'wss://relay.damus.io', pass: true, passrate: 0.875, suites: {...} }

API

Auditor

class Auditor {
  constructor(conf?: IAuditorConf)
  detectSupportedNips(relay: string): Promise<void>
  test(relay: string): Promise<IAuditorResult>
  run(relay: string): Promise<IAuditorResult>
  addSuite(suite: string, options?: any): void
  removeSuite(suite: string): void
  abort(): void
  get result(): IAuditorResult
  get suites(): Set<string>
}

constructor(conf?)

Creates a new Auditor instance. If no configuration is passed, the Nip01 suite runs by default.

| Option | Type | Default | Description | |--------|------|---------|-------------| | nips | Set<string> | new Set(['Nip01']) | Suite names to run (e.g., 'Nip01', 'Nip11') | | options | Record<string, any> | {} | Per-suite options keyed by suite name |

detectSupportedNips(relay)

Fetches the relay's NIP-11 info document and adds matching NIP suites to the configured suite set. Call this before test() to automatically test only the NIPs the relay claims to support.

test(relay)

Runs all configured NIP suites against the relay URL and returns an IAuditorResult. Equivalent to run().

run(relay)

Alias for test().

addSuite(suite, options?)

Adds a NIP suite by name. Suite names use the format 'NipXX' (e.g., 'Nip42'). Only suites with known test manifests are added; unknown names are silently ignored.

removeSuite(suite)

Removes a NIP suite from the configured set.

abort()

Emits an abort signal to all active suites. Use when you need to cancel an in-progress test run.

IAuditorConf

interface IAuditorConf {
  nips: Set<string>
  options: Record<string, any>
}

IAuditorResult

interface IAuditorResult {
  relay: string
  pass: boolean
  passrate: number
  reason: string
  suites: Record<string, ISuiteResult>
}

| Field | Type | Description | |-------|------|-------------| | relay | string | The relay URL that was tested | | pass | boolean | true if all non-skipped suites passed | | passrate | number | Fraction of non-skipped suites that passed (0–1) | | suites | Record<string, ISuiteResult> | Per-suite results keyed by suite name |

Supported NIP Suites

| Suite name | NIP | Description | |------------|-----|-------------| | Nip01 | NIP-01 | Basic relay protocol (filters, subscriptions, event publishing) | | Nip02 | NIP-02 | Contact list events | | Nip11 | NIP-11 | Relay information document | | Nip22 | NIP-22 | Comment events | | Nip42 | NIP-42 | Authentication of clients to relays | | Nip50 | NIP-50 | Search capability | | Nip65 | NIP-65 | Relay list metadata | | Nip77 | NIP-77 | Negentropy syncing |

SuiteTest pattern

Individual NIP tests extend SuiteTest and implement a test() method that uses a behavior assertion helper:

import {SuiteTest, type ISuiteTest} from '@nostrwatch/auditor'

export class FilterLimit extends SuiteTest implements ISuiteTest {
  readonly slug: string = 'FilterLimit'
  limit: number = 1

  get filters() {
    return [{limit: this.limit}]
  }

  test({behavior}) {
    behavior.toEqual(this.totalEvents, this.limit, 'returned correct number of events')
    behavior.toBeOk(this.totalEvents > 0, 'returned at least one event')
  }
}

Known Limitations

  • Incomplete filter range testing: Ambiguity handling in filter range selection is unimplemented (TODO in FilterRange.ts). Filter range selection for timestamp-based queries may produce incorrect ranges in edge cases. No workaround is available at this time. See CONCERNS.md — Incomplete Filter Range Testing.

Agent Skills

No agent skills defined yet for this package.

Related Packages

  • @nostrwatch/nocap — low-level relay connection primitives; auditor builds on nocap adapters internally
  • @nostrwatch/nip66 — NIP-66 event types; audit results can be published as NIP-66 relay status events
  • @nostrwatch/route66 — persistent relay monitoring that uses auditor for health checks

License

MIT