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

@diamondjs/primafacie

v2.2.2

Published

Primafacie logging paradigm - typed, symbol-tagged, caller-aware Print() with pluggable sinks

Readme

💎 @diamondjs/primafacie

One logging vocabulary for your whole stack: Print(logType, message) — typed, symboled, greppable, and pluggable from browser console to datestamped server files.


What is this?

Primafacie is the DiamondJS logging paradigm. One call shape, everywhere — the framework's own narration (router decisions, guard outcomes, dev-mode route tables) and your application logs share a single vocabulary:

import { Print } from '@diamondjs/primafacie';

Print('STARTING', 'boot sequence');
Print('SUCCESS', 'corpus loaded: 1,204 documents');
Print('FAILURE', 'save rejected: version conflict');

Every line carries a type, a symbol, a timestamp, and the caller — color-coded via ANSI in terminals and CSS in browser consoles, and routed to the right console method (log/info/warn/error) automatically.

# Usually installed via the app meta-package (exact-pinned constellation):
npm install @diamondjs/app

# Or standalone:
npm install @diamondjs/primafacie

Sinks — where lines go

Console output is the default. Add sinks for anything else:

import { addSink, wsSink } from '@diamondjs/primafacie';

// Browser → server log relay over WebSocket
addSink(wsSink('ws://localhost:9600/logs'));

On the server side (Node), the /node entry point receives the relay and writes datestamped files:

import { fileSink, wsReceiver } from '@diamondjs/primafacie/node';

const onMessage = wsReceiver(fileSink('./logs'));
// wire onMessage into your WebSocket server; browser Print() lines
// land in ./logs/<date>.log with their types and callers intact

Custom sinks are just functions receiving a structured LogRecord — implement LogSink and addSink it.

Why a logging package in a frontend framework?

Because debuggability is the whole point. DiamondJS narrates its own runtime decisions — every guard allow/deny/throw/timeout, every route commit — through Print, so your log stream shows the framework's reasoning in the same greppable vocabulary as your own logs. In dev mode the router prints its entire resolved route table at startup, one line per route; "where's the route map?" is answered by your console.

Design constraints

  • < 400 LOC — currently ~75% of budget

Part of DiamondJS — the first JavaScript framework designed for the human-LLM collaborative development era.

License

MIT