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

@rulecad/viewer

v0.2.1

Published

A model page you can host anywhere: open model links, or drop an STL to see it, check it for printing and share it. Plain static files; nothing is uploaded.

Readme

@rulecad/viewer

A model page you can host anywhere, as plain static files: no server code, no build, no accounts. Try it at jonibach.github.io/rulecad: drop an STL on it.

  • Open a model link (#m=…, made by cad link or @rulecad/model-link): the model turns slowly, and you can drag to turn it yourself. A parts panel shows, hides and restyles each part and ticks the ones a download holds. Downloads are STL, or 3MF in Bambu Studio's layout with each part on its filament slot.
  • On a phone: the model and an info pane share the screen, with the model on top in portrait and on the left in landscape, so nothing covers it. The Parts button swaps the parts panel into the pane, and the rules sheet opens there too. Drag the grip between the two to change how the screen is shared (it's remembered), or double tap it to go back to half and half.
  • Things that move: a link with joints (a cad assembly with joints and poses) gets a Motion panel. It has a slider for each joint, a button for each pose, and, when you let a slider go, a quick look for parts pushed into each other.
  • Or drop an STL file on it: the page draws it, checks it for printing (bed, flat base, overhangs, bridges, closed solid; @rulecad/printcheck), and turns the address into a link that holds the model, ready to share.
  • Nothing is uploaded. The model lives in the link's #fragment, which browsers never send to the web host, so a public page can open private designs. Links are read as data, never run as code. (Short links, #s=<id>, fetch their data from a GitHub Gist.)

Host your own

The page is the site/ folder. Copy it anywhere that serves files:

npm pack @rulecad/viewer && tar xzf rulecad-viewer-*.tgz   # package/site/ is the page
  • GitHub Pages: put the files of site/ in a repository and turn on Pages (Settings → Pages → deploy from branch). site/ already has the .nojekyll file that makes Pages serve the files as they are.
  • Anything else: Netlify, Cloudflare Pages, a Raspberry Pi running python3 -m http.server. It needs no headers or rewrites, just a .mjs file served as JavaScript.
  • Then point cad at it: "viewUrl": "https://you.github.io/models/" in your cad.config.json.

Working on it

site/view.mjs is the page and site/index.html its layout and styles. node scripts/build.mjs copies the link format and the print check in beside them (--three rebuilds the trimmed three.js after a name is added to its list). node --test test/viewer.browser.mjs from the repository root drops an STL into the page in headless Chrome and saves screenshots.

three.js (MIT, site/three.LICENSE) draws the model.