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

@ledgerwriter/ledger-kit

v0.1.1

Published

Accounting/finance helpers for tiny-cqrs: double-entry invariants, decimal-safe amounts, an audit-log projection helper.

Readme

ledger-kit

Accounting/finance helpers for tiny-cqrs: double-entry invariants, decimal-safe amounts, and an audit-log projection helper. This is the first "flavor" package built on tiny-cqrs — it's an ordinary consumer of the core library, not a plugin; a construction-kit or media-kit would follow the exact same pattern with no changes to tiny-cqrs itself.

Status: pre-1.0 (currently v0.1.1), tracking tiny-cqrs's own pre-1.0 status.

This repo sets the *-kit naming precedent for flavor packages (see tiny-cqrs's README) — that's a discoverability convention only, not a shared interface. There's no contract this package implements that a future construction-kit or media-kit would also need to; each is just an ordinary package depending on tiny-cqrs.

Install

npm install tiny-cqrs @ledgerwriter/ledger-kit

What's in here

  • Cents / parseCents / formatCents / sumCents — amounts are always integer cents (bigint), never floats. parseCents("0.1") + parseCents("0.2") === parseCents("0.3"), which is not true of 0.1 + 0.2 in floating point — exactly the kind of bug you don't want in a ledger.
  • assertBalanced(lines) — the core double-entry invariant. Call it from your decide() before returning a posting event; it throws a DomainError('UNBALANCED_ENTRY', ...) (from tiny-cqrs) if debits don't equal credits, so an unbalanced entry becomes a rejected command, never corrupt books.
  • loadAuditLog(store, tenantId, describe) — a chronological, cross-aggregate audit trail derived directly from the event stream (via StorageAdapter.loadTenantLog), no separate table. You supply describe because only your app knows how to render its own event types as human-readable lines.

Example

See test/journal-entry.integration.test.ts for a minimal JournalEntry aggregate composing tiny-cqrs's executeCommand with assertBalanced — the shape a real migration (e.g. ledgerwriter.com's journal-entry-commands.ts) follows.

Contributing

Bug reports, additional accounting helpers, and documentation fixes are welcome — see CONTRIBUTING.md for how to get set up and what's in vs. out of scope for this repo specifically.

License

Apache-2.0