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

cap-tree-core

v0.3.0

Published

Reference implementation of the CAP-Tree v0.3 data model: JCS canonicalization, content addressing, Ed25519 envelopes, and the normative verification algorithms (spec § 6).

Readme

cap-tree-core

Reference implementation of the CAP-Tree v0.3 data model: JCS canonicalization, content addressing, Ed25519 signature envelopes, structural validation, and the normative verification algorithms (spec § 6).

  • Zero runtime dependencies. WebCrypto only — the same code runs in Node ≥ 20 and modern browsers.
  • Vector-pinned. The test suite reproduces every committed test vector byte-for-byte and rejects tampered variants.
  • Courier-agnostic. Verification takes a Resolver you supply; every fetched payload is checked against the reference hash before it is believed.

Install

npm install cap-tree-core   # (not yet published — use the workspace path for now)

Usage

import {
  generateKeyPair, signEnvelope, verifyObject,
  verifyRootChain, verifyMerge, verifyRefs, objectHash,
} from 'cap-tree-core';

// Identity is a keypair; the fingerprint is who you are.
const me = await generateKeyPair();

// Every object is signed into a self-contained envelope.
const genesis = await signEnvelope({
  type: 'tree-root', specVersion: 3,
  ownerFingerprint: me.fingerprint,
  adminFingerprints: [], entries: [], parents: [],
  policy: null, approvals: [],
  message: 'genesis', timestamp: new Date().toISOString(),
}, me.privateJwk, me.publicJwk);

const treeId = await objectHash(genesis.payload); // the repo's name, forever

// Verify a chain fetched from an untrusted courier:
const resolve = async (ref) => myStore.get(ref.hash) ?? null;
const verdict = await verifyRootChain(tipEnvelope, treeId, resolve);
if (!verdict.ok) console.error(verdict.errors);

// Evaluate a merge against the policy its target branch declares:
const merge = await verifyMerge(mergeEnvelope, treeId, resolve);
merge.policySatisfied; // render the green badge — or don't

// Detect refs equivocation (silent force-push):
const refs = await verifyRefs(refsEnvelope, { treeId, resolve, previous: lastSeen });
refs.equivocation; // true = the owner or courier is lying about history

API surface

| Module | Exports | |---|---| | encoding | canonicalize, canonicalBytes, toBase64url, fromBase64url | | crypto | objectHash, blobHash, sha256, fingerprint, generateKeyPair, signEnvelope, verifyEnvelope | | objects | validateObject, validatePathSegment, all object types | | verify | verifyObject (§ 6.1), verifyRootChain (§ 6.2), verifyMerge (§ 6.3), verifyRefs (§ 6.4) |

Test

npm test   # builds, then runs the vector + verification suites

MIT