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

@facturify/core

v0.1.1

Published

Pure verdict algebra, claim matching, hash chain and reconciliation. No I/O.

Readme

@facturify/core

The engine behind Facturify — verifiable receipts for agent payments.

Pure: no I/O, no Node built-ins, no dependencies. It runs unchanged in Node, in Cloudflare Workers and in the browser. Give it a claim and the movements a rail observed; it returns a verdict.

pnpm add @facturify/core

Verdicts have three states, and they never collapse

import { matchClaim } from '@facturify/core'

const verdict = matchClaim(claim, movements)
// { state: 'settled',     evidence, ambiguous, candidates }
// { state: 'not-settled', reason: 'no-matching-movement' }
// { state: 'unknown',     reason: 'rail-unreadable' | … }

unknown is a first-class outcome. "I could not look" is not "there is nothing." A chain read that failed, reported as not-settled, is the failure this library exists to prevent — so movements === null (the rail could not be read) never becomes an empty list.

Ambiguity is declared, not resolved

Without a txHash, matching on (payTo, asset, amount, window) cannot tell two identical payments apart. matchClaim returns the earliest with ambiguous: true and a candidate count. It never silently picks one.

The audit trail

import { appendEntry, verifyChain } from '@facturify/core'

const entry = await appendEntry(previous, 'verdict', payload, ts)
await verifyChain(entries)   // → { valid: true, entries: n }

SHA-256 over a canonical serialization (keys sorted, bigint tagged so 100n and "100" can never collide). verifyChain is exported deliberately: anyone holding an export must be able to check it without us. A verifier you have to trust is not a verifier.

Reconciliation

Six outcomes plus unreadable, in precedence order:

mismatch › unlogged-debit › late-settlement › credit › ok

The one that matters is unlogged-debit: it alerts even when the balance adds up. Comparing a single number lets two movements cancel out — an unrecorded debit plus a similar incoming credit nets to zero, and a balance-only check signs off. An audit trail that netting can fool is not doing its job.

Money is bigint

Every amount is atomic units as bigint, across the whole public surface. A number here is a money bug waiting to happen.

License

Apache-2.0