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

pikchr-js

v0.1.4

Published

Pikchr diagram markup language ported to Javascript

Readme

Pikchr.js - Generate pikchr diagrams in the browser

CI npm version npm downloads license

Try the browser editor at abetlen.github.io/pikchr-js.

What is Pikchr? From the official documentation:

Pikchr (pronounced "picture") is a PIC-like markup language for diagrams in technical documentation.

Pikchr.js allows you to turn Pikchr markup into svg diagrams directly in your browser.

Installation

npm install pikchr-js

Usage

Browser

<div id="diagram"></div>
<script src="https://unpkg.com/pikchr-js"></script>
<script>
  async function main() {
    const pikchr = await loadPikchr();
    document.getElementById("diagram").innerHTML = pikchr("box");
  }

  main();
</script>

Node.js

const loadPikchr = require("pikchr-js");

async function main() {
  const pikchr = await loadPikchr();
  const svg = pikchr("box");
  const result = pikchr.render("box");
  const darkSvg = pikchr("box", "pikchr", pikchr.flags.DARK_MODE);

  console.log(svg);
  console.log(result.width, result.height);
  console.log(darkSvg);
}

main();

Command Line

Run the bundled pikchr binary via npx or bunx.

npx pikchr-js -div-center diagram.pikchr diagram.svg
bunx pikchr-js -dark diagram.pikchr > diagram.svg
echo "box" | npx pikchr-js -src -div - > diagram.svg

The CLI syntax is identical to upstream pikchr: pikchr [options] ?INFILE? ?OUTFILE?. Supported options are -dark, -src, -div, -div-indent, -div-center, -div-left, -div-right, -div-toggle, and -div-source. Input and output filenames default to stdin and stdout, and - can be used to force either side.

Example

This Pikchr source:

box "Pikchr" fit fill white
arrow
box "SVG" fit fill white

renders as:

Pikchr example diagram

See the Pikchr user manual for the full markup reference.

Contributing

Pull request titles and changelog entries

Use pull request titles in the form <tag>: <title>, with an optional scope when it adds clarity.

Prefer tags such as feat, fix, chore, ci, docs, and refactor.

Add changelog entries under ## [Unreleased] using the pull request title followed by by @contributor in #1234.

- feat: add support for X by @contributor in #1234
- fix(ci): repair Y build by @contributor in #1234

Publishing to npm

This repository publishes npm releases from the publish.yml GitHub Actions workflow when a GitHub Release is published.

Configure npm Trusted Publishing for pikchr-js before publishing a release.

Use these values in the npm package settings:

  • Publisher: GitHub Actions
  • Organization or user: abetlen
  • Repository: pikchr-js
  • Workflow filename: publish.yml
  • Environment name: npm-publish
  • Allowed action: npm publish

Create a GitHub environment named npm-publish and add required reviewers if you want manual approval before npm receives the OIDC publish request.

Trusted Publishing requires GitHub-hosted runners, and the workflow uses Node.js 24 so the npm CLI supports OIDC authentication.

For each release, merge a release PR that updates package.json, package-lock.json, and CHANGELOG.md, then create and publish a GitHub Release whose tag exactly matches the package version in vX.Y.Z form.

The publish workflow verifies the tag against package.json, installs dependencies without a package-manager cache, runs tests, checks the tarball contents, and runs npm publish without an NPM_TOKEN secret.

Updating the GitHub Pages site

The static browser editor lives in site/.

Run npm run site:build to build the _site/ artifact locally.

The pages.yml workflow deploys the built site from pushes to main.

Updating pikchr.js

  1. Download the latest source archive of pikchr
  2. Extract the archive outside this repository
  3. In the extracted pikchr source directory, run make pikchr.c
  4. Copy the generated pikchr.c into this repository
  5. Run npm run build to regenerate pikchr.js with the pinned Dockerized Emscripten 5.0.7 build
  6. Run npm test

The Docker image is pinned so regenerated wasm output does not drift when new Emscripten releases are published.

If upstream Pikchr changes its SVG output, update the test fixture in test.js to match the new generated output.

License

This project is licensed under the 0BSD license.