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

@candypoets/nipworker

v0.94.0

Published

Nostr client library with worker-based architecture using Rust WASM

Downloads

1,912

Readme

@candypoets/nipworker

A high-performance Nostr client library that moves everything off the main thread and becomes your entire application state layer.

npm version License: MIT

What is NIPWorker?

Big, opinionated, and built for speed. FlatBuffers and Web Workers at its core, compiled from Rust to WASM.

Framework Agnostic

Works with any frontend. No React dependency, no Svelte stores to learn, no Vue composables. Just hook-like methods with callbacks that you wire to your framework's reactivity however you want.

4 Dedicated Workers

Connections — Relay connections, WebSocket lifecycle, reconnection backoff. Owns all network I/O.

Cache — Stores FlatBuffers in ring buffers in real time and IndexedDB in timeout chunks. No refetching what you already have.

Parser — Event validation, signature verification, content parsing. Receives raw JSON from relays, outputs FlatBuffers to your frontend. No JSON.parse on the main thread. Ever.

Crypto — Signing, NIP:04/44 encryption, NIP:46 remote signer sessions, Cashu proof verification.

Each worker runs in its own Web Worker. The main thread just orchestrates. Heavy work happens in parallel.

FlatBuffers Instead of JSON

NIPWorker speaks FlatBuffers end to end. Raw relay messages get parsed once in Rust, then flow through the system as zero-copy binary views. No JSON.parse. No object allocation. No GC pauses on infinite scroll.

Your components read directly from FlatBuffers tables. A Kind1 note's content blocks (images, videos, hashtags) arrive pre-parsed. You iterate them with fbArray() and render straight from the binary buffer to the DOM. The schema lives from wire to HTML.

Apollo-Inspired State Management

Like Apollo Client, NIPWorker IS your store. You do not need Redux, Zustand, or custom state libraries.

useSubscribe pulls FlatBuffers from the worker pool and feeds your UI directly. Subscriptions accept fetch policies: cacheFirst serves from memory immediately if available, noCache always bypass the cache and hits the network. You control the speed versus freshness tradeoff per query.

usePublish sends events and tracks relay acknowledgments. Your entire app state flows through these two hooks. Subscriptions are deduped across components automatically. The library manages the cache, merge logic, and reactive updates.

Pipeline Architecture

Events flow through a processing pipeline: verify → dedupe → filter → transform → store. Each subscription configures its own pipeline. The pipeline runs in the Parser worker before FlatBuffers reach your callback.

Opinionated by Design

NIPWorker enforces outbox model by default. It reads every author's NIP:65 relay list to discover where they publish. The library manages relay discovery and publication strategy for you.

Built for clients that need to render thousands of events without dropping frames.

Installation

npm install @candypoets/nipworker

Install the skill for AI assistance:

npx skills add candypoets/skills@nipworker

Quick Start

import { createNostrManager, setManager } from '@candypoets/nipworker';
import { useSubscription, usePublish } from '@candypoets/nipworker/hooks';
import { isKind1, asKind1, fbArray } from '@candypoets/nipworker/utils';

// Create and set the global manager
const manager = createNostrManager();
setManager(manager);

// Subscribe to events
const unsubscribe = useSubscription(
  'feed_home',
  [{ kinds: [1], limit: 50, relays: ['wss://relay.example.com'] }],
  (msg) => {
    const kind1 = isKind1(msg);
    if (kind1) {
      // Access content blocks directly from FlatBuffers view
      const blocks = fbArray(kind1, 'contentBlocks');
      renderNote(blocks);
    }
  }
);

Supported NIPs

| NIP | Description | Status | |-----|-------------|--------| | NIP-01 | Basic Protocol | ✅ Full | | NIP-02 | Contact List | ✅ Full | | NIP-04 | Encrypted DMs | ✅ Full | | NIP-18 | Reposts | ✅ Full | | NIP-19 | bech32 Entities | ✅ Full | | NIP-25 | Reactions | ✅ Full | | NIP-44 | Versioned Encryption | ✅ Full | | NIP-46 | Nostr Connect | ✅ Full | | NIP-51 | Lists | ✅ Full | | NIP-57 | Lightning Zaps | ✅ Full | | NIP-60 | Cashu Wallet | ✅ Full | | NIP-61 | Nutzaps | ✅ Full | | NIP-65 | Relay Lists | ✅ Full |

Documentation

See AGENTS.md for detailed architecture documentation.

License

MIT License - see LICENSE for details.


Made with ❤️ by So Tachi