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

node-dep-resolver

v1.2.0

Published

A lightweight CLI tool & library to build dependency graphs and resolve semver conflicts.

Downloads

869

Readme

node-dep-resolver

A lightweight, transparent JavaScript dependency graph builder and semver conflict resolution engine with backtracking search.

npm version unit tests e2e tests license

node-dep-resolver analyzes package dependencies, constructs visual dependency trees, highlights version conflicts across transitive packages, and uses a backtracking algorithm to find compatible resolution trees.


Features

  • Dependency Graph Visualization: Recursively traces root and transitive dependencies, rendering clear ASCII tree structures.
  • Semver Conflict Detection: Identifies overlapping or incompatible version constraints requested across different packages.
  • Backtracking Resolution Engine: Evaluates alternative candidate package versions to automatically resolve conflicts.
  • CLI & Programmatic Library: Use instantly via npx node-dep-resolver or import into Node.js ES Module projects.

Installation & CLI Usage

You can run the CLI directly on any package.json file:

npx node-dep-resolver ./package.json

Or install it globally:

npm install -g node-dep-resolver
dep-resolver ./package.json

CLI Output Preview

[INFO] Analyzing dependencies from './package.json'...

--- Building Dependency Graph ---
[email protected]
  └── accept-hosts ^1.3.8
  └── send 0.18.0

ms [CONFLICT]
  └── requested 2.1.3 by [email protected]
  └── requested 2.0.0 by [email protected]

[WARNING] Conflicts detected in 2 package(s): ms, debug

--- Resolving Conflicts ---
Starting resolution...

[SUCCESS] Valid dependency tree found.

========== RESOLVED DEPENDENCY SOLUTION ==========

  [OK] express: 4.18.2 (satisfies requested range '4.18.2')
  [OK] express-rate-limit: 7.5.0 (satisfies requested range '7.5.0')
  [UPGRADE] axios: 1.7.0 -> 1.20.0 (satisfies requested range '^1.7.0')

Programmatic Usage (Node.js / ESM)

Install as a dependency in your Node.js project:

npm install node-dep-resolver

Resolving Dependencies Programmatically

import Resolver, { Registry, Graph } from "node-dep-resolver";

const rootDependencies = {
  "express": "4.18.2",
  "express-rate-limit": "7.5.0",
  "axios": "^1.7.0"
};

// 1. Resolve conflicts
const resolver = new Resolver(rootDependencies);
const solution = await resolver.resolve();

for (const [packageName, data] of solution) {
  console.log(`${packageName}@${data.version}`);
}

// 2. Fetch registry metadata
const registry = new Registry();
const resolvedVersion = await registry.resolveVersion("axios", "^1.0.0");
console.log(`Resolved axios version: ${resolvedVersion}`);

Architecture

Built with a modular, Object-Oriented design:

  • Registry: Manages NPM registry HTTP requests and caches package version metadata.
  • Constraint: Tracks requested Semver ranges per dependency and detects overlaps.
  • Conflict: Maintains state sets of active dependency conflicts.
  • Candidates: Generates candidate alternative versions for conflicting transitive dependencies.
  • Graph: Constructs and formats dependency hierarchy trees.
  • Resolver: Orchestrates state snapshots and backtracking resolution search.

License

MIT (c) debanjan