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

repository-linking-lib

v1.1.1

Published

Dependency-graph driven npm link/unlink/build tooling for working on local libraries side by side

Readme

repository-linking-lib

Dependency-graph driven tooling for working on a set of local npm libraries side by side. Given a graph of repositories and their inter-dependencies, it can npm link / npm unlink them in the correct topological order, and build / unbuild the ones that publish a compiled entry point.

The library ships only the engine. Each consuming repository provides its own graph definition (the config) and a tiny entry point that runs it.

Operations

| Operation | What it does | | --- | --- | | info | Prints the graph and, per edge, whether the link is currently active. | | link | npm links every repository that has dependents globally, then links each repo's local dependencies. | | unlink | Reverts links: npm unlink -g for shared repos and npm install to restore published deps. | | build | Runs npm run build + npm run prepack on repos that declare a publishConfig.main. | | unbuild | Runs npm run postpack to revert a build. |

Usage in a consuming repository

Add the dependency (local, unpublished libraries are typically consumed via npm link or a file: reference) and create two files.

scripts/repository-linking/main.ts — the entry point (operation is read from the CLI argument):

import { Repository, RepositoryLinking, type RepositoryLinkingOperation } from 'repository-linking-lib';

let helpers = new Repository('../../../Libraries/Your-Library');

let framework = new Repository('../../Framework/Your-Framework');
framework.addDependency(helpers);

let root = new Repository('.');
root.addDependency(helpers);
root.addDependency(framework);

runRepositoryLinking(process.argv.slice(2)[0] as RepositoryLinkingOperation);

Wire up npm scripts that pass the operation as the argument:

{
  "scripts": {
    "info-repos": "tsx scripts/repository-linking/main.ts info",
    "link-repos": "tsx scripts/repository-linking/main.ts link",
    "unlink-repos": "tsx scripts/repository-linking/main.ts unlink",
    "build-repos": "tsx scripts/repository-linking/main.ts build",
    "unbuild-repos": "tsx scripts/repository-linking/main.ts unbuild"
  }
}

API

  • Repository — a node in the graph. new Repository(relativePath) and .addDependency(other).
  • runRepositoryLinking(options?) — runs an operation. options.operation defaults to process.argv[2]; options.rootPath defaults to process.cwd().
  • RepositoryGraph / RepositoryStatus — the resolved graph, exposed for custom tooling.