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

@weasel-js/cursor

v1.7.0

Published

Tool cursors as authored glyphs: bake one to a CSS url() cursor string, or paint it when it is too big to be one.

Readme

@weasel-js/cursor

Tool cursors as authored glyphs.

import { cursorFor } from '@weasel-js/cursor';

const tool = defineTool({
  id: 'pencil',
  cursor: cursorFor('pencil', { fallback: 'crosshair' }),
});

A glyph is a set of SVG path d strings with paint roles and a hotspot in glyph units. cursorFor bakes one into a CSS cursor value and memoizes it.

Always pass a fallback. If the browser rejects the image the element falls back to that keyword, and with none declared it lands on auto.

Cursors ship as SVG with no bitmap fallback: Chrome rasterizes an SVG data-URI cursor at device scale, so it is already crisp on a retina display. bakeCursor throws above 128 CSS px rather than emitting a cursor the browser would drop silently.

Authoring a glyph

Geometry lives in scripts/glyphs/ and is generated to resolved literals:

npm run gen:cursors      # regenerate src/glyphs.ts
npm run proof:cursors    # render every glyph over three grounds

Proof a change before committing it. The proof sheet draws each glyph at 11x for geometry and embeds the baked asset at 24 and 16 px — those are separate checks and they disagree, which is the point. A glyph that reads at 11x and turns to mush at 24 has failed.

The register is a filled silhouette with a white halo, deliberately unlike the toolbar icon sets (@weasel-js/ui's ICON_PATHS, core's tool icons), which are fill: none outlines in currentColor. An unfilled glyph over dark artwork is a dark outline around a dark hole, and a baked image has no cascade to inherit a color from. Share the authoring discipline, not the paths.