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

npm-watchdog

v1.0.2

Published

A cross-platform tool to detect unused dependencies in JavaScript/TypeScript projects

Downloads

15

Readme

npm-watchdog 🐕

A cross-platform command-line tool to detect unused dependencies in JavaScript/TypeScript projects with a modern and stylish UI.

Description

npm-watchdog analyzes your project's source files (.js, .jsx, .ts, .tsx) and detects which packages listed in your package.json are not being used in the source code. It's like having a watchdog guarding your forgotten dependencies.

npm-watchdog screenshot

Cross-Platform Compatibility

npm-watchdog works on all major platforms:

  • Windows
  • macOS
  • Linux

The tool is designed to handle path differences, file system operations, and other platform-specific issues automatically.

Modern UI Features

  • Beautiful ASCII art header
  • Colorful gradients and styled text
  • Progress spinners while analyzing
  • Boxed sections for better readability
  • Tabular data presentation
  • Cross-platform compatibility tweaks for terminals

Installation

Global installation (recommended)

npm install -g npm-watchdog

Local installation

npm install --save-dev npm-watchdog

Usage

Basic usage

# If installed globally
npm-watchdog

# If installed locally
npx npm-watchdog

Options

# Show help
npm-watchdog --help

# Export results in JSON format
npm-watchdog --json

# Ignore certain modules in the analysis
npm-watchdog --ignore axios,lodash

# Specify a different base path (useful for monorepo projects)
npm-watchdog --root ./packages/my-package

# Change language (English is default, Spanish is also available)
npm-watchdog --lang es

# Use minimal UI mode (no ASCII art, useful for CI/CD environments)
npm-watchdog --minimal

Multilanguage Support

npm-watchdog supports multiple languages:

  • English (default): --lang en
  • Spanish: --lang es

Example:

npm-watchdog --lang es

UI Modes

Full UI (default)

Beautiful ASCII art and styled output with animations and colors.

Minimal UI

npm-watchdog --minimal

Simplified output without the large ASCII art header. Useful for CI/CD environments or smaller terminals.

How it works

npm-watchdog:

  1. Reads your package.json and extracts all dependencies (dependencies and devDependencies)
  2. Recursively looks for all .js, .jsx, .ts, .tsx files in your project
  3. Analyzes each file looking for:
    • require('module')
    • import xyz from 'module'
    • import * as xyz from 'module'
    • import 'module'
  4. Compares the dependencies found with those listed in package.json
  5. Reports packages that are not being used in any file

Requirements

  • Node.js 12 or higher

Limitations

  • Does not detect dynamic imports (require(variable))
  • Does not analyze files with custom extensions
  • Does not detect imports in comments or disabled code

License

MIT