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

painbrush

v3.3.2

Published

<div align="center">

Downloads

71

Readme

Painbrush

""

to my knowledge, the only node-based bitmap raster drawing program - i do not wish to be challenged on this.

HEY!! this is still undergoing lots of active dev so updates may break. im sticking to semver as much as a i can but yk take care

You can use this lib to generate images and text in the much loved bmp format. It's handy for og images for example, if you want that retro look ig.

Getting started

import { brush } from "painbrush/color";
import { useFont, getDefaultFontHandleNode } from "painbrush/font";
import { exportImage } from "painbrush/image";
import { makeLayer } from "painbrush/layer";

const POXEL = await useFont(getDefaultFontHandleNode());
const clock = makeLayer.text(
  Date.now().toString(),
  POXEL,
  brush.solidFill(0xc0ffee),
);

await writeFile('image.bmp', exportImage(clock));

Your code wont look that clean tho, see this example file for detailed comments. Whole directory is really good stuff. I'm not a good doc writer

There's more good stuff in there and the code is typescripted and somewhat commented so just have a play around

Painbrush in use

  • The aforementioned example
  • i intend to put this on my website at a minimum but unfortunately i am awaiting for npm support to recover access to my account because i didnt set up a passkey or something
  • Packing a font creates a specimen file. see how at the end of this.

Packing a font?

Ah my pride and joy. You can see how this is set up in the examples project as well. Painbrush uses a custom pixel font format.

First you will need a pixel font. I make mine in aseprite and left them here if you wanna play around with them. Annoyingly you need to work in 2 bits (indexed color, 2 colors) or things won't work. your sprite can be in any format you want as long as its a consistent grid of letters, in any order.

""

Save this as a bmp and next we need a little manifest for it, which is a json file with the same name except its json you get this right

{
  "metrics": {
    "height": 9, // height of the grid you made
    "width": 7, // width of the grid you made
    "spaces": 4 // how wide you want spaces to be
  },
  "cols": 11, // how many columns in your grid
  "alphabet": [
    // write out the letters you drew in the same order, include gaps
    "?1234567890",
    "!          ",
  ],
  // for characters that are too thin to look good as monospace, define how many pixels to shave off their right edge
  "trim": {
    "!": 3,
    "__DEFAULT__": 1 // if most of your characters need trim set this and then override the rest
  }
}

there's some example manifests here that use these features (and even some more!)

when you are done run painbrush-font-packer. you can install this globally or reference it in your package.json, i dont really care what you do tbh

painbrush-font-packer -f ./fonts/pongers -o /assets

✓ Found bmp, json is valid
✓ 69 characters in pongers
✓ Wrote pxfont file at /projects/monalisa/assets/pongers.pxfont
✓ Wrote specimen file at /projects/monalisa/assets/pongers-specimen.bmp (check it out!)

✓ You can now use pongers as a font

You'll get a cool specimen file for your troubles, with all the characters. this is great to keep open if you are messing with the spacing too:

""

And then just import it.

Thats all!

I'd love to know if this brought you joy or you are using it! ping me on bsky (@freezydorito.lol) if you do!!