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

@semrel-extra/topo

v1.14.2

Published

Helpers to assist monorepo dependencies traversals

Readme

@semrel-extra/topo

CI Maintainability Code Coverage

Helpers to assist monorepo dependencies traversals

Install

yarn add @semrel-extra/topo

Usage

import { topo } from '@semrel-extra/topo'

const graph = await topo({
  workspaces: ['packages/*'],
  cwd: '/path/to/project/root'
})

{
  queue: ['pkg-a', 'pkg-b', 'pkg-z', 'pkg-y', 'pkg-x'],
  nodes: ['pkg-a', 'pkg-b', 'pkg-x', 'pkg-y', 'pkg-z'],
  edges: [
    ['pkg-a', 'pkg-b'],
    ['pkg-z', 'pkg-y'],
    ['pkg-y', 'pkg-x'],
  ],
  // packages entries map
  packages: {
    'pkg-a': {
      manifest: {
        name: 'pkg-a',
        dependencies: {}
      },
      manifestPath: '/path/to/project/root/packages/a/package.json',
      path: 'packages/a', // legacy
      relPath: 'packages/a',
      absPath: '/path/to/project/root/packages/a'
    },
    'pkg-b': {...},
    ...
  }
}

pkgFilter() / filter()

Filter option is a function: gets IPackageEntry as argument, returns boolean

const graph = await topo({
  workspaces: ['packages/*'],
  cwd: '/path/to/project/root',
  filter: ({manifest}) => !manifest.name.startsWith('internal-') // omit internal packages
})

depFilter()

Applies filter to any kind of pkg dependencies to omit them from the graph.

const graph = await topo({
  workspaces: ['packages/*'],
  cwd: '/path/to/project/root',
  depFilter: ({version}) => version.startsWith('workspace:') // include only workspace deps
})

workspacesExtra

Injects extra pattern to the resolved workspaces value from package.json / pnpm-workspace.yaml

const graph = await topo({
  workspacesExtra: ['!packages/foo'],
  cwd: '/path/to/project/root'
})

traverseDeps()

Iterates up to the pkg deps graph.

import {topo, traverseDeps} from '@semrel-extra/topo'
import type {IDepEntryEnriched} from '@semrel-extra/topo'

const {packages} = await topo({
  workspaces: ['packages/*'],
  cwd: '/path/to/project/root'
})
const pkg = packages['pkg-a']
const cb = async ({pkg}: IDepEntryEnriched) => {
  await traverseDeps({pkg, packages, cb})
}

await traverseDeps({packages, pkg, cb})

traverseQueue()

Iterates over the queue of packages in the order of their dependencies.

import {topo, traverseQueue} from '@semrel-extra/topo'

const {queue, prev} = await topo({
  workspaces: ['packages/*'],
  cwd: '/path/to/project/root'
})
const cb = async (name: string) => {
  // some async action
}
await traverseQueue({ queue, prev, cb })

Development

Use Node.js 26 and Yarn 1.22. The published CommonJS and ESM builds are smoke-tested on Linux with Node.js 18 and 26, and Windows with Node.js 26. Public exports and legacy package path fields are preserved.

yarn install --frozen-lockfile
yarn build
yarn test

yarn lint runs Oxlint; yarn format applies Prettier. Tests check formatting without changing files. The build uses TypeScript 7 for declarations and esbuild for JavaScript. js-yaml stays on the maintained 4.x line to preserve parsing of existing workspace files, including YAML merge keys.

yarn test:smoke checks the built CommonJS and ESM APIs using only production dependencies and Node.js's test runner. yarn test:it remains an alias for it.

CI and publishing

CI builds once and shares the JavaScript and declaration files through an artifact named build. Unit tests, lint and type checks run once on Linux/Node.js 26. The smoke matrix and release job download that same build instead of rebuilding it.

Build and test jobs have only read access to repository contents, no OIDC permission and no repository secrets. Checkout credentials are not persisted. Tests upload coverage as a separate artifact named coverage. On pushes to master, the release job sends it to Qlty before publishing, including when there is no new package version to publish. A later publishing failure does not prevent that upload. Only the release job gets publishing permissions; npm lifecycle scripts are disabled there so building and testing stay in the unprivileged jobs.

The release job uses npm trusted publishing through GitHub OIDC. Configure a trusted publisher for @semrel-extra/topo with:

  • Organization: semrel-extra
  • Repository: topo
  • Workflow filename: ci.yaml
  • Environment: gh-cicd
  • Permission: npm publish

The first successful publication must happen within two days of creating the publisher. An expired configuration must be deleted and recreated. See npm trusted publishing.

Publishing uses the built-in GITHUB_TOKEN. Committer details can be set through the GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL repository variables, and SSH signing through the optional GIT_SIGN_KEY secret.

Coverage uploads use Qlty OIDC; enable the project in Qlty before the first upload. CodeQL is configured in codeql-analysis.yml for JavaScript/TypeScript and GitHub Actions. Keep GitHub's CodeQL default setup disabled while this workflow is in use.

License

MIT