@deppie/cli
v1.0.0
Published
Beautiful npm dependency tree visualizer with interactive explorer, i18n, security audit, unused package detection and more
Maintainers
Readme
deppie
🎨 Beautiful npm dependency tree visualizer with interactive explorer, i18n support, security audit, unused package detection and more.
Overview
deppie is a powerful command-line tool that displays your npm dependency tree in a beautiful, easy-to-read format. Unlike the built-in npm ls command, it provides a rich set of features for analyzing, auditing and managing your project dependencies.
Short alias: You can also use dep as a shorter alternative.
Features
✨ Core Features:
- 🌳 Beautiful ASCII Tree — Clean, organized dependency tree with colored output
- 📏 Package Sizes — See disk space usage per dependency
- 🔢 Version Info — Display package versions at a glance
- 🎯 Depth Control — Limit tree depth with
--depth <n> - 📊 Statistics — Bar charts, top 10 largest packages, summary analytics
- 🔍 Duplicate Detection — Find packages installed in multiple versions
- 🛡️ Security Audit — Integrated npm audit vulnerability check
- ⏫ Outdated Packages — Interactive updater with yes/no confirmation
- 🗑️ Unused Package Detection — Find & remove packages not referenced in code
- 🔎 Package Search — Search dependency tree by name, version, or description
- 🖥️ Interactive Tree Explorer — Navigate dependency tree with keyboard
- 🌍 i18n — 4 languages: English, Türkçe, Deutsch, Français
- 🔧 Persistent Config — Language preference saved at
~/.deppie/config.json
Installation
Global Installation (Recommended)
npm install -g deppieLocal Installation
npm install deppie --save-devUsage
Navigate to your project directory and run:
deppie # or: depAll Options
| Flag | Description |
|------|-------------|
| --depth <n> | Show only <n> levels deep |
| --only-prod | Show only production dependencies |
| --only-dev | Show only dev dependencies |
| --stats | Show dependency statistics with bar charts |
| --duplicates | Find duplicate packages (multiple versions) |
| --security | Check security vulnerabilities (npm audit) |
| --outdated | Interactive outdated package updater |
| --unused | Find & interactively remove unused packages |
| --search <keyword> | Search packages in dependency tree |
| --all | Show tree + stats + duplicates combined |
| --interactive | Interactive tree explorer (keyboard navigation) |
| --format <fmt> | Output format: tree (default), json |
| --lang | Change language (en, tr, de, fr) |
| --help | Show help |
Examples
# Default: show dependency tree
deppie
# Limit depth to 2 levels, production only
deppie --depth 2 --only-prod
# Show everything: tree + stats + duplicates
deppie --all
# Statistics with bar charts
deppie --stats
# Find duplicate packages
deppie --duplicates
# Security audit
deppie --security
# Interactive outdated package updater
deppie --outdated
# Find & remove unused packages
deppie --unused
# Search for a package
deppie --search chalk
# Interactive tree explorer
deppie --interactive
# Output as JSON
deppie --format json
# Change language
deppie --langFeature Details
📊 Statistics (--stats)
Shows a detailed breakdown of your dependencies with visual bar charts:
┌─────────────────────────────────────────────────────┐
│ STATISTICS │
└─────────────────────────────────────────────────────┘
Summary:
Total size: 31.46 MB
Total packages: 294
Production: 5
Development: 3
Average size: 109.59 KB
Top 10 Largest Packages:
1. webpack 5.53 MB ████████████████████
2. moment 4.15 MB ███████████████░░░░░
3. axios 2.31 MB ████████░░░░░░░░░░░░⏫ Outdated Packages (--outdated)
Interactive TUI — navigate with arrow keys, press Enter to update a package. Asks for confirmation (Yes/No) before running npm install pkg@latest.
OUTDATED PACKAGES - interactive mode
────────────────────────────────────
> express 4.18.2 → 4.21.0 production
lodash 4.17.21 → 4.17.25 production
jest 29.5.0 → 29.7.0 devDependency
↑/↓ navigate Enter update q/Esc quit🗑️ Unused Packages (--unused)
Scans all source files (.js, .ts, .jsx, .tsx, .mjs, .cjs, .vue, .svelte) for require() and import statements. Compares against package.json to find packages that aren't referenced anywhere in code. Interactive removal with confirmation.
Smart detection:
- Strips comments (
//,/* */) before scanning — no false positives from commented-out code - Handles template literal expressions —
${...}blocks are excluded - Recognizes
require(),require.resolve(), staticimport, and dynamicimport() - Supports scoped packages (
@scope/pkg) - Also checks
package.jsonscripts for CLI tool usage
UNUSED PACKAGES - interactive mode
──────────────────────────────────
Scanned 42 source files | 3 unused package(s) found
> moment production
old-lib production
unused-tool devDependency
? Remove moment from project?
[ Yes ] [ No ]
↑/↓ navigate Enter remove q/Esc quit🔎 Package Search (--search <keyword>)
Search for packages in the dependency tree by name, version, or description. Results are displayed with highlighted matches, size info, and type indicators.
>> SEARCH — 3 result(s) for "express"
Scanned 294 packages in node_modules
────────────────────────────────────────────────────
Package Version Size Type
────────────────────────────────────────────────────
express 4.18.2 210.5 KB production
express-session 1.17.3 45.2 KB nested
required by connect
express-rate-limit 6.7.0 12.1 KB nested
required by api-server🖥️ Interactive Tree Explorer (--interactive)
Full keyboard-driven tree navigation:
- ↑/↓ — Navigate between packages
- Enter/Space — Expand or collapse a node
- e — Expand all nodes
- c — Collapse all nodes
- q/Esc — Quit
🛡️ Security Audit (--security)
Runs npm audit and presents vulnerabilities grouped by severity (Critical, High, Moderate, Low) with colored output.
🔍 Duplicate Detection (--duplicates)
Finds packages installed in multiple versions across node_modules, helping identify bloat.
🌍 Internationalization (i18n)
On first run, deppie asks you to select a language:
Select language / Dil seciniz:
> English
Türkçe
Deutsch
FrançaisYour choice is saved to ~/.deppie/config.json. Change anytime with deppie --lang.
Programmatic Usage
const { getDependencyTree, getRawTree } = require('deppie');
// Get formatted tree string
const tree = getDependencyTree(process.cwd(), { depth: 2 });
console.log(tree);
// Get raw tree object
const raw = getRawTree(process.cwd(), { depth: 3 });
console.log(JSON.stringify(raw, null, 2));Requirements
- Node.js >= 12.0.0
- npm >= 6.0.0
How It Works
- Reads
package.json— Identifies all dependencies and devDependencies - Analyzes
node_modules— Traverses modules to find installed sizes and versions - Calculates Sizes — Recursively calculates disk space per package
- Builds Tree — Creates a hierarchical dependency representation
- Formats Output — Renders with colors, sizes, bar charts, and versions
Comparison with npm ls
| Feature | deppie | npm ls | |---------|:---:|:---:| | Beautiful colored output | ✅ | ❌ | | Package sizes | ✅ | ❌ | | Bar chart statistics | ✅ | ❌ | | Interactive tree explorer | ✅ | ❌ | | Security audit integration | ✅ | ❌ | | Outdated package updater | ✅ | ❌ | | Unused package detection | ✅ | ❌ | | Package search | ✅ | ❌ | | Duplicate detection | ✅ | ❌ | | Multi-language (i18n) | ✅ | ❌ | | JSON export | ✅ | ✅ |
License
MIT
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
Made with ❤️ by Görkem for developers
