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

setup-trusted-publishing

v1.0.2

Published

Publish a 0.0.0 stub to npm so OIDC trusted publishing can be configured

Readme

setup-trusted-publishing

Publish a minimal 0.0.0 stub to npm so you can configure OIDC trusted publishing.

npm's trusted publishing (provenance) requires a package to already exist on the registry before you can set it up. This tool handles that one-time initial publish — run it once, then configure trusted publishing on npm and let CI take over all real publishes.

If the package already exists, the tool exits 0 and does nothing.

Quick Start

# npm
npx setup-trusted-publishing

# pnpm
pnpm dlx setup-trusted-publishing

Run from your package directory (or pass --cwd <dir>).

On success it prints the package URL so you can click through to configure trusted publishing.

What It Does

  1. Reads your package.json
  2. Checks if the package already exists on the registry — exits 0 if it does
  3. Writes to your package.json (if not already set): publishConfig.access (see Access resolution), publishConfig.provenance: true, and repository (auto-detected from git remote)
  4. Publishes a minimal stub (0.0.0, no real source) to reserve the name

Options

| Flag | Short | Description | | ------------------ | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | --dry-run | -n | Print the stub manifest without publishing or writing anything | | --no-publish | | Write publishConfig.access, pack the stub tarball, copy it to --cwd — but don't publish. For package managers not directly supported (e.g. yarn). | | --access <mode> | | Set access to public or restricted. Required for scoped packages with no existing publishConfig.access. | | --force | -f | Bypass access conflict errors (e.g. --access public conflicting with an existing restricted setting) | | --registry <url> | | Registry to check and publish to (defaults to your .npmrc / npm default) | | --cwd <path> | -C | Source package directory (defaults to current directory) | | --help | -h | Show help |

Scoped Packages

Scoped packages (@org/name) default to restricted access on npm. You must explicitly set the access level — either via --access, publishConfig.access in your package.json, or "private": true.

# Publish as public
pnpm dlx setup-trusted-publishing --access public

# Publish as restricted (private registry / npm Teams)
pnpm dlx setup-trusted-publishing --access restricted

Supported Package Managers

Detected automatically from package.json#packageManager or npm_config_user_agent:

| Package manager | Support | | --------------- | ------------------------------------------------------------- | | npm | Full | | pnpm | Full | | yarn | Use --no-publish to pack the tarball, then publish manually |

The Stub Package

The published tarball contains exactly three files:

| File | Contents | | -------------- | ------------------------------------------------ | | package.json | See below | | index.js | module.exports = {}; — a no-op CommonJS module | | README.md | A one-line notice identifying this as a stub |

Stub package.json

Fields always included:

  • name — from your source package.json
  • version — always "0.0.0"
  • main — always "index.js"
  • description — from source, or "Stub package for npm trusted publishing setup" if absent
  • publishConfig.access — resolved access level (see Access resolution)

Fields copied from source if present and non-empty: author, contributors, license, homepage, repository, bugs, keywords

Fields not copied into the stub: dependencies, devDependencies, peerDependencies, scripts, bin, exports, type, engines, and publishConfig.provenance (provenance is a publish-time OIDC flag that errors when passed via a tarball — your CI publishes set it from your updated source package.json)

Access resolution

publishConfig.access is resolved in this priority order and written to your source package.json when changed:

| Condition | Resolved value | Written to source package.json? | | -------------------------------------------------------------- | ----------------------------------------------- | --------------------------------- | | --access <flag> differs from existing publishConfig.access | error — use --force to overwrite | — | | --access public when "private": true | error — remove "private" or use --force | — | | --access <flag> matches existing publishConfig.access | existing value | no | | --access <flag>, no existing value | flag value | yes | | No flag, publishConfig.access already set | existing value | no | | No flag, "private": true | restricted | yes | | No flag, no existing, not private | public | yes |

Further Reading

Requirements

Node.js >=24.4.0

License

MIT