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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@simbo/monorepo-packages-list-cli

v1.0.3

Published

A CLI that generates a list of a monorepo's packages details and injects it into a markdown file.

Readme

Monorepo Packages List CLI

📦 @simbo/monorepo-packages-list-cli

A CLI that generates a list of monorepo packages with metadata and injects it into a markdown file.

Uses @simbo/monorepo-packages-list as a library.

Installation

Install @simbo/monorepo-packages-list-cli from the npm registry:

npm i [-D|-g] @simbo/monorepo-packages-list-cli

Alternatively, run it using npx or a similar tool:

npx @simbo/monorepo-packages-list-cli

Usage

Minimum Setup

In the README.md file of your monorepo, add a HTML comment marker to inject the packages list:

<!-- PACKAGES -->
<!-- /PACKAGES -->

Run the CLI to generate the packages list:

npx @simbo/monorepo-packages-list-cli

A package list will be injected into the HTML comment markers.

Configuration File

For customizing the output, create a configuration file in the root of your monorepo.

Use one of the following default config file names or provide a custom one using --config=<FILE>:

  • monorepo-packages-list.config.ts
  • packages-list.config.ts
  • monorepo-packages-list.config.js
  • packages-list.config.js

The configuration file should export a Config object or an array of Config objects.

A Config object can contain all options of @simbo/monorepo-packages-list and an optional targetFile path as alternative to using CLI parameters.

Example for Custom URLs

This configuration simply enhances the default template with custom URLs.

import {
  defineConfig,
  type WorkspaceMetadata,
} from '@simbo/monorepo-packages-list-cli';

export default defineConfig({
  templateData: {
    repoUrlFn: (workspace: WorkspaceMetadata) =>
      `https://github.com/USER/REPO/tree/main/${workspace.relativePath}/`,
    packageUrlFn: (workspace: WorkspaceMetadata) =>
      workspace.private
        ? undefined
        : `https://www.npmjs.com/package/${workspace.name}`,
    docsUrlFn: (workspace: WorkspaceMetadata) =>
      `https://USER.github.io/REPO/modules/${workspace.name.replaceAll(/[^\da-z-]/gi, '_')}/`,
    readmeUrlFn: (workspace: WorkspaceMetadata) =>
      `https://github.com/USER/REPO/blob/main/${workspace.relativePath}/README.md`,
    changelogUrlFn: (workspace: WorkspaceMetadata) =>
      `https://github.com/USER/REPO/blob/main/${workspace.relativePath}/CHANGELOG.md`,
  },
});

Advanced Example for Multiple Files

This example uses a full custom template and edits two files:

  • README.md with a one-liner including a package count
  • PACKAGES.md with a full list of packages and their details
import {
  defineConfig,
  type TemplateData,
  type WorkspaceMetadata,
} from '@simbo/monorepo-packages-list-cli';

export default defineConfig([
  {
    targetFile: 'README.md',
    templateFn: () => '',
    delimiter: '',
    before: (workspaces: WorkspaceMetadata[]) =>
      `There ${workspaces.length === 1 ? 'is' : 'are'} currently _**${workspaces.length}**_ package${workspaces.length === 1 ? '' : 's'} managed in this repository.`,
  },
  {
    targetFile: 'PACKAGES.md',
    templateFn: async (
      workspace: WorkspaceMetadata,
      data: TemplateData,
    ): Promise<string> => {
      const { name, title, version, description, folderName } = workspace;
      const {
        repoUrlFn,
        packageUrlFn,
        docsUrlFn,
        readmeUrlFn,
        changelogUrlFn,
      } = data as Required<TemplateData>;

      const repoUrl = await repoUrlFn(workspace);
      const packageUrl = await packageUrlFn(workspace);
      const docsUrl = await docsUrlFn(workspace);
      const readmeUrl = await readmeUrlFn(workspace);
      const changelogUrl = await changelogUrlFn(workspace);

      const folder = repoUrl
        ? `[**\`./packages/${folderName}\`**](${repoUrl})`
        : `**\`./packages/${folderName}\`**`;
      const pkg = packageUrl ? `[\`${name}\`](${packageUrl})` : `\`${name}\``;

      const links: string[] = [];
      if (readmeUrl) links.push(`[README.md](${readmeUrl})`);
      if (changelogUrl) links.push(`[CHANGELOG.md](${changelogUrl})`);
      if (docsUrl) links.push(`[Documentation](${docsUrl})`);

      return [
        `- ### **${title}**`,
        `  > ${description}`,
        `  📂 ${folder}`,
        `  📦 ${pkg} @ \`${version}\``,
        ...(links.length > 0 ? [`  ${links.join('  •  ')}`] : []),
      ].join('\n\n');
    },

    templateData: {
      // Same as previous example.
    },
  },
]);

Related Packages

License

MIT © Simon Lepel