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

consequitur

v0.3.2

Published

A ledger of what was said, and what follows from it.

Readme

consequitur

A ledger of what was said, and what follows from it.

A thread is an append-only list of lines. Each line has a gist (what happened), a writer, a timestamp and a free JSON payload, and its id is the hash of its content and of the line before it, so a thread is a chain that cannot be changed behind your back. A schema, written as JSON, says who may write each gist, when, and what it implies: a value on the record, someone joining or leaving a set, another line taken out of force. consequitur reads the thread, compares what it implies with what the record holds, and answers every difference by writing a line. Goals wait for lines and write one when met; laws judge what a line would cause; a dry run tells you before you send it.

The reading is pure: no clock, no randomness, no I/O. Two readers of one thread agree.

npm install consequitur
import { readSchema, BASE_KIT, emptyState, dryRun, post, offers } from 'consequitur';

const { schema, problems } = readSchema(activitySchema, BASE_KIT); // your schema, as JSON
if (problems.length > 0) throw new Error(problems.join(' ')); // a schema with a problem reads as the empty one
let state = emptyState(schema);

const draft = { gist: 'create', writer: 'user::mrossi', payload: { name: 'Review request', assignTo: ['mrossi'] } };
const now = new Date().toISOString(); // the host's clock: the engine never reads one

const preview = await dryRun(state, draft, schema, now);
// preview.added: the line, then what reconciliation writes after it

const result = await post(state, draft, schema, now);
if (!result.refusal) state = result.state;
offers(state.lines, 'user::mrossi', schema); // what this writer may post on the thread as it stands

What is in it

  • the line, its id (sha256: and the hash, in RFC 8785's canonical form), the chain that is the reading order, and the first line's declaration (a nonce, and the name and version of the schema that reads it);
  • readSchema, with kinds registered in a kit (BASE_KIT has the base handle, rule and law kinds): a domain is data, and a new kind of consequence is registered, not forked in;
  • conditions (when, goals, laws) written in the condition language of kdlet-guards, the one runtime dependency;
  • the reading, consequitur: what is in force, what the lines expect, the goals, the holes and the denunciations;
  • post, dryRun, settle, diff and a policy for what the authority leaves unanswered;
  • offers: what a writer may post on the thread as it stands;
  • scenarios (playScenario, prune, stepsOf, holed): a domain's stories as data, and templates saved from a thread;
  • consolidation: two threads made one by replay, never by merge. consolidate, deriveSchema, and a drill (startDrill, stepDrill) that walks the replay one step at a time and stops where a schema conflict or a refused step needs a choice.

A schema can also be written in KDL with consequitur-kdl (reference), and a reading drawn into the DOM with consequitur-render (reference).

Documents

The documents are in five shelves: tutorial, how-to guides, reference, explanation and project, all in docs/ of the repository.

MIT.