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

@williamthorsen/nmr

v0.5.0

Published

Context-aware script runner for PNPM monorepos

Readme

@williamthorsen/nmr

Context-aware script runner for PNPM monorepos. Ships an nmr (node-monorepo run) binary that provides centralized, consistent script execution across workspace packages and the monorepo root.

Installation

pnpm add -D @williamthorsen/nmr

CLI usage

nmr <command>                         # Context-aware: root vs package
nmr -F, --filter <pattern> <command>  # Run in matching packages
nmr -R, --recursive <command>         # Run in all packages
nmr -w, --workspace-root <command>    # Force root script registry
nmr -?, --help                        # Show available commands
nmr --int-test <command>              # Use integration test scripts

Examples

# From a package directory
nmr test                    # Runs workspace test script
nmr build                   # Runs compile && generate-typings

# From the monorepo root
nmr test                    # Runs root test + recursive workspace tests
nmr ci                      # Runs check:strict && build

# Targeting specific packages
nmr -F core test            # Test only the core package
nmr -R lint                 # Lint all workspace packages

# Force root context from anywhere
nmr -w check                # Run root check from a package dir

Configuration

Create .config/nmr.config.ts in the monorepo root to add or override scripts:

import { defineConfig } from '@williamthorsen/nmr';

export default defineConfig({
  workspaceScripts: {
    'copy-content': 'tsx scripts/copy-content.ts',
  },
  rootScripts: {
    'demo:catwalk': 'pnpx http-server --port=5189 demos/catwalk/',
  },
});

Three-tier override system

  1. Package defaults — built-in scripts shipped with this package
  2. Repo-wide config — additions/overrides in .config/nmr.config.ts
  3. Per-package overrides — in a package's package.json scripts field

Per-package overrides take highest precedence. Set a script to "" in package.json to skip it for that package.

Script values can be string or string[]. Arrays expand to chained nmr invocations:

// "build": ["compile", "generate-typings"]
// expands to: nmr compile && nmr generate-typings

Additional subcommands

These commands are available as nmr subcommands and as standalone nmr--prefixed binaries (for use in lifecycle hooks).

report-overrides

Report any active pnpm.overrides in the root package.json. Useful as a postinstall hook to remind developers of active overrides that may need cleanup.

nmr report-overrides

sync-pnpm-version

Synchronize the pnpm version from the root package.json packageManager field into the GitHub code-quality.yaml workflow file.

nmr sync-pnpm-version

Standalone utilities

ensure-prepublish-hooks

Verify that all publishable workspace packages have a prepublishOnly script. Exits non-zero if any are missing.

ensure-prepublish-hooks              # Check only
ensure-prepublish-hooks --fix        # Add missing hooks (default: "npm run build")
ensure-prepublish-hooks --dry-run    # Preview what --fix would do
ensure-prepublish-hooks --command "pnpm build"  # Use a custom hook command

Consumer migration

After installing, a consuming repo's root package.json scripts shrink to lifecycle hooks:

{
  "prepare": "lefthook install",
  "postinstall": "nmr report-overrides"
}

Per-package package.json files no longer need script entries. Run nmr <command> directly.

Consistency tests

Export structural consistency checks for use in your test suite:

// __tests__/consistency.test.ts
import { runConsistencyChecks } from '@williamthorsen/nmr/tests';

runConsistencyChecks();

This verifies:

  • pnpm version matches between package.json and GitHub workflow
  • Node.js version matches between .tool-versions and GitHub workflow