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

@repo-toolkit/publish-packages

v0.6.0

Published

Build, stage, and publish every package in a monorepo to npm

Readme

@repo-toolkit/publish-packages

Build, stage, and publish every package in a monorepo to npm in dependency order.

Installation

pnpm add -D @repo-toolkit/publish-packages

CLI

repo-toolkit-publish-packages --version v1.2.3

Run the binary from the monorepo root. publish-packages discovers packages under packages/*, sorts them by internal dependency order, filters the selection, and then calls @repo-toolkit/publish-package for each package.

--tag is still accepted as a compatibility alias, but --version is the preferred spelling.

Useful flags:

  • --config <path> Config file with publish options (JSON, .mjs, or .cjs default export). CLI flags override config values.
  • --cwd <path> Monorepo root directory (default: process.cwd()).
  • --version <version> Target version (required). A leading v is stripped.
  • --tag <version> Compatibility alias for --version.
  • --npm-tag <dist-tag> npm dist-tag (defaults to the prerelease preid).
  • --filter <name>[,<name>] Only publish matching packages (by name or directory). Applied before --from.
  • --from <name> Start publishing from the first package matching this selector, computed against the post---filter list.
  • --package-files <file>[,<file>] Files copied from each package root into the publish dir.
  • --root-files <file>[,<file>] Files to copy from the monorepo root into each publish dir (default: ['LICENSE']). Missing files are skipped.
  • --publish-dir <path> Publish directory inside each package (default: dist).
  • --version-placeholder <text> Placeholder rewritten to the target version (default: 0.0.0-PLACEHOLDER).
  • --build-command <command> Command used to build each publish dir (default: pnpm build).
  • --skip-build Skip the build step.
  • --access <level> npm publish access level (default: public).
  • --registry <url> npm registry URL.
  • --otp <code> npm OTP code.
  • --provenance Request npm provenance attestation.
  • --dry-run Forward --dry-run to npm publish.

Config File

Use --config when you want repo-specific options without spelling them on the command line. JSON, .mjs, and .cjs (default / module.exports) configs are all supported; use a JS file when you need non-JSON values.

/** @type {import('@repo-toolkit/publish-packages').PublishPackagesOptions} */
export default {
  version: '1.2.3',
  filters: ['changelog'],
  packageFiles: ['README.md', 'llms.txt'],
  rootFiles: ['LICENSE', 'NOTICE'],
  publishDir: 'dist',
  versionPlaceholder: '0.0.0-PLACEHOLDER',
  buildCommand: 'pnpm build',
  dryRun: true,
};

Run it with:

repo-toolkit-publish-packages --config publish.config.mjs

CLI flags override values from the config file.

JavaScript API

import { publishPackages } from '@repo-toolkit/publish-packages';

publishPackages({
  version: '1.2.3',
  cwd: '/path/to/monorepo',
  filters: ['changelog'],
  packageFiles: ['README.md', 'llms.txt'],
  rootFiles: ['LICENSE', 'NOTICE'],
  publishDir: 'dist',
  versionPlaceholder: '0.0.0-PLACEHOLDER',
  dryRun: true,
});

Exports

  • sortPackagesByInternalDependencies(...) Topologically sort internal packages (throws on cycles).
  • resolvePublishPackagesPlan(options) Resolve the selected package list and shared publish options without publishing.
  • publishPackages(options) Run the full workspace publish pipeline.
  • inferNpmTag(version) Derive the npm dist-tag from a version string.

For generic single-package manifest rewriting and npm publish plumbing, use @repo-toolkit/publish-package.

Options

  • version (string, required) Target version. A leading v is stripped.
  • cwd (string) Monorepo root directory. Defaults to process.cwd().
  • npmTag (string) npm dist-tag. Defaults to the prerelease preid.
  • filters (string[]) Only publish matching packages (by name or directory).
  • from (string) Start publishing from the first matching package.
  • packageFiles (string[]) Files copied from each package root into the publish dir.
  • rootFiles (string[]) Files to copy from the monorepo root into each publish dir (default: ['LICENSE']). Missing files are skipped.
  • publishDir (string) Publish directory inside each package (default: dist).
  • versionPlaceholder (string) Placeholder rewritten to the target version (default: 0.0.0-PLACEHOLDER).
  • buildCommand (string) Command used to build each publish dir (default: pnpm build).
  • skipBuild (boolean) Skip the build step.
  • access (string) npm publish access level (default: public).
  • registry (string) npm registry URL.
  • otp (string) npm OTP code.
  • provenance (boolean) Request npm provenance attestation.
  • dryRun (boolean) Forward --dry-run to npm publish.

Version Placeholders

Dependency ranges set to 0.0.0-PLACEHOLDER are replaced with the target version by default. Override this with versionPlaceholder / --version-placeholder when your workspace uses a different sentinel value.

workspace: ranges on internal packages are resolved to the target version (or kept verbatim when pinned to an explicit version).