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

@casoon/runemark

v0.8.1

Published

Native Node.js terminal presentation powered by Runemark

Readme

@casoon/runemark

Native terminal presentation for Node.js command-line tools, powered by the Runemark Rust renderer. It provides consistent status messages, reports, errors, file-change previews, and progress output without maintaining a second JavaScript renderer.

Requires Node.js 20 or newer.

Install

npm install @casoon/runemark

Status messages

RunemarkConsole renders text without writing it. Use the write* methods when output should go directly to a stream.

const { RunemarkConsole } = require('@casoon/runemark')

const console = new RunemarkConsole({ color: 'auto' })

console.writeInfo('Starting site audit')
console.writeSuccess('42 pages checked')
console.writeWarning('3 images need alt text')
console.writeError('Audit could not finish')

const text = console.success('Build complete')
process.stdout.write(`${text}\n`)

Use color: 'never' for snapshots and plain logs. color: 'auto' is TTY-aware and is the default.

Reports

Reports use a versioned plain-object contract. Keep schemaVersion: 1 when constructing reports; it prevents the Node interface from depending on Rust implementation types.

const { RunemarkReport, Verdict } = require('@casoon/runemark')

const report = new RunemarkReport({
  schemaVersion: 1,
  title: 'Accessibility audit',
  verdict: Verdict.Warning,
  metrics: [
    { key: 'Pages checked', value: '42', verdict: Verdict.Passed },
    { key: 'Findings', value: '3', verdict: Verdict.Warning },
  ],
  groups: [
    {
      title: 'Images',
      findings: [
        {
          message: 'The logo has no text alternative',
          tone: 'warning',
          ruleId: 'wcag2a/1.1.1',
          location: { kind: 'url', value: 'https://example.com/' },
          remedy: 'Add a concise alt attribute to the image.',
        },
      ],
    },
  ],
  nextSteps: [
    { text: 'Fix the image alternative and run the audit again.' },
  ],
})

process.stdout.write(report.render({
  color: process.stdout.isTTY ? 'always' : 'never',
  width: process.stdout.columns,
}))

For one-off reports, use renderReport(input, options) instead.

A metric's verdict renders that verdict's symbol in front of it, which is what makes a metric readable as a status rather than only as a number:

[WARN] Accessibility audit
[OK] Pages checked: 42   [WARN] Findings: 3

Prefer it to tone alone. A tone is colour and nothing else, so in a pipe, in CI or under NO_COLOR a failing metric reads exactly like a passing one. The verdict also supplies the tone where none is set, so the two cannot drift apart; an explicit tone still wins, whichever order they are given in.

Errors and file changes

const { renderDiff, renderError } = require('@casoon/runemark')

process.stderr.write(renderError({
  heading: 'Browser executable not found',
  explanation: 'The audit needs a local browser.',
  commands: ['npx playwright install chromium'],
}, { color: 'auto' }))

process.stdout.write(renderDiff({
  changes: [
    { action: 'added', path: 'reports/a11y.json' },
    { action: 'modified', path: 'src/audit.ts', delta: '+18 -4' },
  ],
}, { color: 'auto' }))

Progress

Progress output uses stderr, leaving stdout free for JSON, SARIF, or other machine-readable artifacts. With mode: 'auto', progress is interactive only for a terminal and stays line-oriented when redirected.

const { createProgress, Verdict } = require('@casoon/runemark')

const progress = createProgress({ mode: 'auto' })
progress.start(42, 'Checking pages')

for (let page = 1; page <= 42; page += 1) {
  progress.advance(page, `Checked page ${page}`)
}

progress.finish(Verdict.Passed, 'Audit complete')

API and compatibility

The stable public API consists of RunemarkConsole, RunemarkReport, RunemarkProgress, and the renderStatus, renderReport, renderError, renderDiff, and createProgress helpers. TypeScript declarations are bundled with the package. See the repository's Node API contract for the compatibility policy.