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

@kehto/nip

v0.8.1

Published

Tree-shakable bundle of unique Nostr NIP utilities for napplet runtimes — each NIP at its own subpath (e.g. @kehto/nip/66)

Downloads

6,678

Readme

@kehto/nip

A tree-shakable bundle of unique Nostr NIP utilities for napplet runtimes — the NIPs that nostr-tools does not ship but that relay-aware runtimes commonly need. Each NIP lives in its own folder at its own subpath, so consumers import only what they use; the package is sideEffects: false, so bundlers drop any NIP that isn't referenced.

NIPs

| Subpath | NIP | What it provides | |---------|-----|------------------| | @kehto/nip/5a | NIP-5A | aggregate hash compute/verify over path tags (computeAggregateHash, verifyAggregate) | | @kehto/nip/5d | NIP-5D | content-addressed napplet manifest resolution — parse, verify signature + artifact bytes (or legacy aggregate/blobs) (resolveNapplet) with optional Cache Storage artifact caching, plus source pin and presentation media parsing/verification helpers | | @kehto/nip/51 | NIP-51 | lists & sets parser — mute/bookmarks/relay-sets/emoji-sets/… (parseList) | | @kehto/nip/65 | NIP-65 | relay-list (kind 10002) parsing + outbox/inbox resolution (createNip65Registry) | | @kehto/nip/66 | NIP-66 | kind-30166 relay-discovery aggregator (createNip66Aggregator) | | @kehto/nip/89 | NIP-89 | app-handler discovery (kind 31989/31990) (parseHandlerInformation) |

Each subpath has its own README with full API docs and examples (linked above). More unique NIPs are added as their own subpath (@kehto/nip/<n>) over time.

For browser hosts that want repeated NIP-5D loads to reuse verified artifact bytes, see the repo guide: Implement a napplet artifact cache.

NIP-5D archetype manifest contracts

Kehto follows NAP-INTENT PR #106 at fc121fc264615482143eda86125863d2e1f741a2 and NIP-5D PR #2303 at 020cb8b33a9e4c6b8ca4b2f9d0ed0a67843b68f7. Current manifests declare roles with z and contracts with ["i", "napplet:<role>/<action>", ...parameterNames]. Only an intent whose role is also declared by z is eligible. Invalid advertisements are ignored; they do not invalidate otherwise valid artifact metadata.

resolveNapplet() exposes manifest.archetypes as ordered { slug, convention, params } entries. Parameter names describe text fields, not types or required values. Legacy paired archetype tags retain empty params. manifest.catalogId, also available through getNappletCatalogId(event), is publisher/kind-safe: named events use kind, publisher and literal d-tag; roots use kind and publisher; snapshots use kind and event ID. Callers treat this ID as opaque. The existing dTag/artifact hash remains separate artifact metadata.

NIP utilities verify these facts; services and hosts select and run handlers.

Selection criteria

A NIP earns a place here only if it is:

  1. Unique — not already provided by nostr-tools (re-wrapping nip04, nip19, nip25, nip44, nip57, … would be a no-op package).
  2. Broadly needed — likely required by many runtimes, not just one app.
  3. Substantive — handles a real common case in a widely-compatible way, with no framework coupling and no module-global state.

Usage

// Import only the NIP you need — nothing else is bundled.
import { createNip65Registry } from '@kehto/nip/65';

const registry = createNip65Registry();
registry.ingest(kind10002Event);
const outbox = registry.resolveOutboxRelays([authorPubkey]);

A convenience barrel re-export is also available at the package root (@kehto/nip), but prefer subpath imports for the smallest bundles.

Conventions

Every NIP module is:

  • Pure / framework-agnostic — no Svelte/React, no DOM assumptions, no relay library baked in. Relay pools, signers, and decryptors are injected via small interfaces.
  • Multi-instance safe — stateful helpers are closure-scoped factories (create*), never module globals, so multiple runtimes in one process never alias each other.
  • Fully documented — all public exports carry JSDoc with @param, @returns, and @example.

Adding a NIP

  1. Create src/<n>/index.ts implementing the NIP utility (framework-agnostic, no module-global state, inject relay/pool/crypto concerns via interfaces).
  2. Add src/<n>/index.test.ts with unit tests and src/<n>/README.md with API docs.
  3. Add src/<n>/index.ts to the tsup entry array and a ./<n> entry to exports in package.json.
  4. Re-export it from src/index.ts for the barrel, and add the @kehto/nip/<n> alias to the repo vitest.config.ts.
  5. Add a row to the table above.

NIP-5D event compatibility

Current manifests use a direct artifact x hash, plain-text content, role-matched z/i intent declarations, and required R / optional O domains. Kehto also accepts legacy aggregate events through an isolated compatibility adapter. Existing aggregateHash host/cache/ACL fields carry the verified artifact hash for current events; legacy identities keep their original aggregate. Both paths verify signatures and bytes before runtime injection and srcdoc execution. For the schema and removal boundary, see event migration.

NIP-5D verification accepts root (15129), named (35129) and snapshot (5129) manifests. Roots and snapshots have no d tag; snapshots are identified by signed event ID. Every kind uses the same signature and artifact-byte verification. Paja accepts root coordinates with an empty NIP-19 naddr identifier and exact nevent references for all three kinds.