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

@withnen/client

v0.4.0

Published

MIT licensed client SDK for end-to-end encrypted API payloads. ML-KEM-768 key exchange + ChaCha20-Poly1305 encryption.

Readme

Nen Client SDK (@withnen/client)

The browser/frontend SDK for Nen — a drop-in fetch replacement that encrypts the payload before it leaves the tab, using a post-quantum (ML-KEM-768) handshake.

Install

npm install @withnen/client

Quick use

import { createNenFetch, createNenStream } from '@withnen/client';

const nenFetch = createNenFetch('');            // '' = same-origin
const data = await nenFetch('/api/secure', {    // returns the decrypted JSON
  method: 'POST',
  body: JSON.stringify({ ssn: '412-55-9087' }),
});

for await (const chunk of createNenStream('')('/api/chat', {
  method: 'POST',
  body: JSON.stringify({ prompt }),
})) {
  process.stdout.write(chunk);                  // decrypted SSE tokens
}

Prefer an explicit instance? new NenClient(serverUrl, { identityMode: 'pqc' }) then await client.handshake(), client.nenFetch(), client.nenStream(), client.rotate(), client.terminate(), client.status().

What it does

  1. Handshake — generates an ML-KEM keypair in Wasm, posts the public key, decapsulates the returned ciphertext into the shared secret, and stores the server-issued HMAC key. With identityMode: 'pqc' it also signs the ephemeral key with ML-DSA. The ML-KEM secret key is zeroized immediately after.
  2. nenFetch — encrypts the JSON body (ChaCha20-Poly1305), sends { ct, n } base64 with the X-Nen-Session, X-Nen-Timestamp, and X-Nen-Signature (HMAC) headers, and decrypts the JSON response.
  3. nenStream — same request leg; yields decrypted SSE chunks as an async generator.
  4. Auto-recovery — on a 401 it transparently rotate()s (fresh handshake) and retries once.

Coded errors

Failures throw an NenError carrying a stable ISO-xxxx code (e.g. ISO-2001 SESSION_NOT_INITIALIZED, ISO-1003 HANDSHAKE_NETWORK). The wire/throw surface never leaks the internal diagnostic hint. Resolve a code with describeNenCode('ISO-1003'). Full catalog: ../../ERROR_CODES.md.

Build & test

npm run build   # tsup → dist/ (CJS + ESM + .d.ts)
npm test        # jest (core-crypto mapped to the Node wasm build for tests)

Notes

  • Session keys live in instance memory only — never localStorage/cookies — and are lost on refresh (a fresh handshake follows). Each tab handshakes independently.
  • The wire format is base64-only ({ ct, n }) as of v0.2.0.

See ../../PROTOCOL.md for the exact protocol.