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

cli-node-graph

v1.0.8

Published

TypeScript codebase knowledge graph analyzer (Nx-style)

Readme

cli-node-graph

TypeScript codebase knowledge graph analyzer — an Nx-style dependency graph tool with deep symbol-level analysis.

npm version License: MIT

Features

  • Deep AST Analysis: Parses TypeScript files to extract classes, interfaces, functions, methods, and decorators.
  • Rich Relationships: Tracks imports, function calls, class inheritance, and structural dependencies.
  • Advanced Graph Algorithms: Includes cycle detection, shortest path, impact analysis, and topological sorting.
  • Multiple Export Formats: Export to JSON, DOT (Graphviz), GraphML, Mermaid, Cytoscape, React Flow, and Neo4j CSV.
  • Visualization Tools: Use the built-in React Flow visualizer for interactive graph exploration.

Installation

Install globally to use the CLI from anywhere:

npm install -g cli-node-graph
# or
pnpm add -g cli-node-graph
# or
yarn global add cli-node-graph

Or run it directly using npx:

npx cli-node-graph <command> [options]

Usage

Analyzing a Project

Analyze a TypeScript codebase to build the knowledge graph:

cli-node-graph analyze ./path/to/project

Exporting the Graph

Export the knowledge graph to various formats (e.g., reactflow, json, dot, mermaid):

cli-node-graph export ./path/to/project --format reactflow -o graph.json

Finding Cycles

Detect circular dependencies in your project:

cli-node-graph cycles ./path/to/project

Impact Analysis

Determine what files or symbols are affected if you change a specific symbol:

cli-node-graph impact UserService ./path/to/project

Project Statistics

View overall statistics of your codebase:

cli-node-graph stats ./path/to/project

API Usage

You can also use cli-node-graph programmatically in your Node.js scripts:

npm install cli-node-graph
import { GraphBuilder, GraphAlgorithms, JsonExporter } from 'cli-node-graph';

// Build the graph
const graph = new GraphBuilder().build({ projectRoot: './my-project' });

// Analyze the graph
const cycles = new GraphAlgorithms(graph).detectCycles();
console.log('Cycles found:', cycles);

// Export the graph
const json = new JsonExporter().export(graph);

Contributing

If you're interested in contributing to the project, please see our Contributing Guide for details on setting up the development environment, architecture, and running tests.

License

MIT