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

oss-matryoshka

v0.1.0

Published

CLI tool to visualize Node.js dependency chains as trees

Downloads

7

Readme

📦 oss-matryoshka

Who brought this dependency? Visualize how dependencies were introduced via dependency chains (OSS Matryoshka).

oss-matryoshka is a CLI tool that explains why a dependency exists in your Node.js project by visualizing dependency chains as readable trees.


📥 Installation

npm install -g oss-matryoshka

or

npx oss-matryoshka graph

🚀 Quick Start

oss-matryoshka graph --targets stackback

This generates Markdown files showing how stackback was pulled into your project, using the auto-detected lock file.


Options

All options are optional. If omitted, sensible defaults are applied.

| Option | Required? | Description | | --------------------------- | :-------: | ------------------------------------------------------------------- | | --lock <path> | No | Explicit lock file path. Overrides auto-detection. | | --targets <pkg,...> | No | Target packages to focus on. If omitted, all packages are included. | | --out <path> | No | Output file path. If omitted, a default filename is generated. | | --roots <prod\|dev\|both> | No | Dependency roots to analyze (default: both). | | --format <md\|txt\|json> | No | Output format (default: md). | | --max-depth <n> | No | Maximum tree depth (default: unlimited). | | --max-nodes <n> | No | Maximum number of nodes (default: unlimited). |


🔍 Lock File Detection

If --lock is not specified, oss-matryoshka looks for package-lock.json in the current directory. If none is found, it returns an error.


📄 Default Output Naming

When --out is omitted, files are generated in the current directory.

Format -> Extension

| Format | Extension | | -------------- | --------- | | md (default) | .md | | txt | .txt | | json | .json |


🔹 Without targets

| Lock file | Output | | ----------------- | ------------------------------ | | package-lock.json | oss-matryoshka.{ext} |


🔹 With targets

oss-matryoshka-{targets}.{ext}

Examples:

oss-matryoshka-stackback.md
oss-matryoshka-foo_bar.md
  • Scoped packages (@scope/pkg) are normalized to scope-pkg
  • Multiple targets are joined with _
  • For long names, use --out

📜 Output Example (Markdown)

Markdown format lists each root package and shows its dependency tree in a fenced block.

- vitest
  ```
  vitest
  └─ why-is-node-running
     └─ stackback
  ```

Why oss-matryoshka

  • Explains why a dependency exists
  • Produces review-ready Markdown
  • Avoids noisy full listings
  • Ideal for license / security / audit explanations

🚫 Non-Goals

  • License or legal judgment
  • Dependency removal
  • Build artifact inspection
  • Automated decisions

🧪 Supported Environments

  • Node.js projects with package-lock.json (npm)
  • SPA / SSG / SSR / libraries