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

storyshelf

v0.19.0

Published

StoryShelf CLI: self-hosted visual testing and review for Storybook.

Readme

storyshelf

The StoryShelf command-line interface (binary storyshelf): scaffold servers, initialize client config, create projects and CI tokens, upload built Storybooks as builds, purge expired builds, and retry failed builds. It talks to a running StoryShelf server over /api/v1 and has no Playwright or server dependencies, so it installs cleanly in CI.

Install

nub add storyshelf

or

npm install -g storyshelf

Quick start

Initialize client config (requires .storybook/main.*):

storyshelf init --url https://shelf.example.com --slug my-app
# writes .storybook/storyshelf.json

Create a project on the server (requires site-admin token and .storybook/main.*):

storyshelf create --url https://shelf.example.com --name my-app --token $SHELF_ADMIN_TOKEN
# prints slug + CI token and writes .storybook/storyshelf.json

Scaffold a server:

npx create-storyshelf --dir ./my-shelf

API

Commands

storyshelf init — initialize .storybook/storyshelf.json (client config). Fails if .storybook/main.* not found. Prompts if flags missing.

storyshelf init --url <url> --slug <slug> [--build-dir <dir> --build-command <cmd> --skip <glob> -c <config>]

storyshelf create — create a project and CI token on a server (requires admin token). Fails if .storybook/main.* not found and writes .storybook/storyshelf.json.

storyshelf create --url <url> --name <name> --token <admin-token>
# or env SHELF_ADMIN_TOKEN

create-storyshelf — scaffold a new StoryShelf server project.

npx create-storyshelf --dir <dir>

storyshelf upload — upload a built Storybook as a build. --url/--slug optional when .storybook/storyshelf.json exists (flags > env > file). The token comes from SHELF_TOKEN (--token warns: arguments show in the process list). --sha/--branch come from the CI provider (the PR head on a pull request), then local git. Running storyshelf with no args is the same command, with no flags: it uploads if config exists, else shows help to run init.

storyshelf upload --url <url> --slug <slug> --token <token> \
  --sha <sha> --branch <branch> \
  [--build-dir <dir> --build-command <cmd> --force-build --skip <glob> -c <config>] [--message <msg>] \
  [--author-email <email>] [--author-name <name>]

The default --build-dir is storybook-static or buildDir from .storybook/storyshelf.json (see Configuration). If buildDir is missing/empty, upload runs buildCommand or npm run <buildScriptName>.

Instance commands (serve, migrate, purge, check-storage, doctor) are in storyshelf-server, a bin of @storyshelf/app; storyshelf purge, storyshelf server … and storyshelf mcp … no longer exist: scaffold with create-storyshelf and @storyshelf/mcp (storyshelf-mcp init|serve).

storyshelf retry — retry a failed build.

storyshelf retry --url <url> --slug <slug> --build-id <id> [--token <token>]

storyshelf protect — print, validate and (only with --apply) write the branch rule that requires StoryShelf's gate status. Dry run by default; needs an admin token for the git host (--token, GITHUB_TOKEN or GITLAB_TOKEN), and talks to the host directly, not to the StoryShelf server. Exits 1 when the rule is missing the check and nothing was written.

storyshelf protect --provider github --repo <owner/repo> [--branch main] [--prefix storyshelf] [--gate testing|review] [--apply]
storyshelf protect --provider gitlab --repo <group/project> [--host <url>] [--apply]

Example CI snippet

# .github/workflows/visual.yml
on:
  push:
  pull_request:

jobs:
  visual:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 24 }
      - run: nub install && nub run build
      - run: nubx storybook build -o storybook-static
      - run:
          nubx storyshelf upload \
          --token "${{ secrets.SHELF_TOKEN }}" \
          --sha "${{ github.sha }}" \
          --branch "${{ github.ref_name }}"
          # --url/--slug from .storybook/storyshelf.json

How it fits in

The server is scaffolded via create-storyshelf, which assembles @storyshelf/core, and @storyshelf/db/sqlite (local storage is built into core) and runs Playwright captures. The CLI never imports that stack — client-only by design.

See docs/architecture.md for the capture workflow and docs/testing.md for the gated browser integration suite.