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

sadrazam

v0.1.8

Published

Dependency analysis CLI for JavaScript and TypeScript projects with optional AI-powered insights.

Readme


⚡ What is Sadrazam?

Sadrazam is a CLI tool that scans your project and tells you:

  • which dependencies are unused
  • which ones are misplaced or risky
  • what you can safely remove or fix

👉 And if you enable AI:
it explains why, what to do next, and supports agent-friendly TOON output for automation and LLM workflows.


🚀 Quick Start

npx sadrazam .

That’s it.


🧠 Example Output

❌ Unused dependency: lodash
💡 Suggested: remove

⚠️ Misplaced dependency: typescript
💡 Suggested: move to devDependencies

With AI:

🧠 lodash is not imported anywhere in your codebase.
Removing it will reduce bundle size and install time.

🎯 Why Sadrazam?

JavaScript projects accumulate dependencies over time.

  • unused packages slow installs
  • wrong dependencies increase risk
  • messy package.json hurts maintainability

Sadrazam answers one question:

👉 What can I safely remove from this project?


🔥 What Makes It Different?

Unlike traditional tools:

  • detects unused dependencies AND unused files/exports
  • understands monorepos and modern frameworks
  • optional AI layer for real explanations (not raw output)
  • safe auto-fix for package.json

⚡ Common Use Cases

  • clean up old projects
  • audit dependency bloat
  • prepare for production
  • CI dependency checks
  • monorepo hygiene

🛠️ Usage

Basic scan:

npx sadrazam .

JSON output:

npx sadrazam . --reporter json

TOON output:

npx sadrazam . --reporter toon

Auto-fix:

npx sadrazam . --fix --format

Trace why something is used:

npx sadrazam . --trace typescript

🧠 AI Mode (Optional)

Enable AI to get explanations and recommendations:

AI_PROVIDER=openai AI_TOKEN=your_token npx sadrazam . --ai

AI will:

  • explain why a dependency is unused
  • suggest what action to take
  • summarize cleanup steps

⚙️ Features

  • unused dependency detection
  • unused file + export detection
  • monorepo & workspace support
  • script-aware scanning
  • CommonJS + modern import support
  • safe auto-fix
  • JSON + TOON + text output
  • AI-powered insights

👉 Full feature list: https://borakilicoglu.github.io/sadrazam/features


📦 Install

npm install -g sadrazam

or:

npx sadrazam .

🧪 When to Use It

Run Sadrazam when:

  • your project feels bloated
  • you're unsure which deps are safe to remove
  • you're preparing for deployment
  • you're reviewing a codebase

💡 Philosophy

Sadrazam is built around a simple idea:

Keep your dependency tree clean, understandable, and safe.

AI is optional — the core tool works without it.


❤️ Support

If this tool saves you time:

⭐ Star the repo
☕ Support via GitHub Sponsors

https://github.com/sponsors/borakilicoglu


🔗 Links

  • GitHub: https://github.com/borakilicoglu/sadrazam
  • npm: https://www.npmjs.com/package/sadrazam
  • Docs: https://borakilicoglu.github.io/sadrazam/features