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

@grafema/rofl

v1.6.0

Published

ROFL — Relation-Oriented Fixpoint Language: a Datalog-family engine with perspectives, explicit time, kernel-emitted provenance and budgets-as-semantics

Readme

@grafema/rofl

ROFL keeps a model of a codebase and answers questions about it with proof. The package has three commands and a library:

  • rofl, the engine (native, Rust): ask, why, whynot, excise over a world of .rofl files, --json for an agent, and rofl scan to read a directory of JavaScript and TypeScript into facts;
  • rofl-nb, the notebook: runs a .rofl.md notebook of sentences, rules and questions, every never an invariant with the exit code to match;
  • rofl-lsp, a language server for .rofl and .rofl.md;
  • import { Rofl } from '@grafema/rofl', the TypeScript engine as a library, and boot.rofl and the rule packs beside it.

Install

Needs Node 22 or later.

npm install -g @grafema/rofl          # or once: npx @grafema/rofl ask ...
npm install -g @grafema/rofl@latest   # later, to update

The engine comes in a package of its own for each platform (@grafema/rofl-linux-x64, -linux-arm64, -darwin-x64, -darwin-arm64, -win32-x64); npm downloads only this machine's. rofl --version says the version and the engine it runs.

The engine, for an agent

rofl scan src --out code.rofl                                     # a directory of JS/TS in, facts out
rofl ask 'depends[code](F, G)' @rules/js.files code.rofl         # the rows, one a line; --json for one JSON line
rofl why 'flows[code]("api/server.js", "api/users.js")' @rules/js.files code.rofl

@rules/js.files is the JS model this package carries, from any directory. A world is kept under ~/.cache/rofl/worlds: the same files asked again are answered from it without evaluating. Exit 0 whole, 2 a file refused, 3 the world, 4 the question, 5 partial, 70 a defect; 127 when the engine for this platform is not installed (the message says which package to install).

The notebook

cp -r "$(npm root -g)/@grafema/rofl/examples" ~/rofl-examples
cd ~/rofl-examples/tutorial && rofl-nb 1-what-ships.rofl.md

The tutorial is a game in six short levels, one new word each. Then:

  • WHAT.md: what ROFL answers, on one small example, and ASKING.md: the same from the command line, with rofl.
  • QUICKSTART.md: the tutorial, a notebook of your own, and one over your code, each with its output.
  • CONCEPTS.md: cells, sentences, rules, asking lines, exit codes, a glossary.
  • WRITING.md: how to write sentences and rules.
  • CHEATSHEET.md: all of it on one screen.
  • DRAWING.md: draw K, a picture of what a notebook concludes, and the examples in examples/visual.

For an agent

rofl-nb <file.rofl.md> [--json] [--cell N] [--all]
rofl-nb vocab [word]
rofl-nb translate <file.rofl.md>

Exit 0: every never holds; 1: a never fails; 2: something was not read; 3: holds only as far as the model sees. AGENTS.md has the snippet for a project's CLAUDE.md and the shape of --json.

The first run starts a kept kernel (the model loads once, 10 to 20 s); later runs take seconds. ROFL_NB_DAEMON=0 runs in the calling process.

rofl-lsp --stdio is a language server for .rofl and .rofl.md for any editor. It reads only the open files, the model and the notebooks named under reads:; it runs nothing and opens no port.