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

reqscan

v1.2.0

Published

Dependency Manager for Node.js — scan, install, clean, and audit your project dependencies

Downloads

463

Readme

reqscan — Dependency Manager for Node.js

reqscan is a powerful CLI tool that scans your Node.js project, detects missing dependencies, and helps you manage them with simple commands. Zero external dependencies.

License: MIT Node.js Version


✨ Features

  • 🔍 Check — Find imported packages missing from package.json
  • 📦 Install — Install all missing packages at once
  • 🧹 Clean — Remove unused/undeclared packages
  • 🔧 Fix — Install missing + clean unused in one shot
  • 🎯 Audit — Full dependency health report with score
  • 📋 List — Show every dependency with its status
  • 🚫 Smart filtering — Ignores built-ins, node_modules, relative imports
  • 📁 Multi-language — Supports .js, .ts, .jsx, .tsx, .mjs, .cjs
  • 🎨 Beautiful output — Color-coded terminal UI
  • Zero dependencies — Lightweight and fast
  • 🔧 Programmatic API — Use it in your own tools

📦 Installation

Global Installation (Recommended)

npm install -g reqscan

Run without installing (npx)

npx reqscan check
npx reqscan install

Local Installation (for CI/CD)

npm install --save-dev reqscan

Then add to your package.json scripts:

{
  "scripts": {
    "deps:check": "reqscan check",
    "deps:fix":   "reqscan fix"
  }
}

🚀 Usage

# Scan current directory
reqscan check

# Scan specific project
reqscan check /path/to/project

# Install all missing dependencies
reqscan install

# Remove unused dependencies
reqscan clean

# Fix everything (install missing + remove unused)
reqscan fix

# Show full project health report
reqscan audit

# Show all packages with their status
reqscan list

📋 Command Reference

| Command | Description | |---------|-------------| | check [dir] | List missing, present, and unused packages | | install | Install all missing packages found by check | | clean | Remove packages declared but never imported | | fix | Run install + clean in one command | | audit | Full dependency health report with score | | list | Show all dependencies with status |


🚩 Available Flags

| Flag | Description | Commands | |------|-------------|----------| | --json | Output machine-readable JSON | check, audit, list | | --save-dev | Install missing packages as devDependencies | install, fix | | --dry-run | Preview changes without executing | install, clean, fix | | --force | Skip confirmation prompt | clean, fix |


📤 Example Outputs

reqscan check

📦 Project: my-app
──────────────────────────────────────────────────
Summary
  Total imports found   : 9
  Declared in pkg.json  : 4
  Already installed     : 3
  Missing (not declared): 2

❌ Missing Packages (not in package.json)
──────────────────────────────────────────────────
  ✗ axios
  ✗ uuid

💡 Run this to install all missing packages:
   npm install axios uuid

✅ Already Declared Packages
──────────────────────────────────────────────────
  ✓ express    ^4.18.0
  ✓ mongoose   ^7.0.0
  ✓ dotenv     ^16.0.0

⚠️  Declared but NOT imported in source (possibly unused)
──────────────────────────────────────────────────
  ~ jest

reqscan audit

🏥 Dependency Health Report
──────────────────────────────────────────────────
  Health Score        : 75%
  Files Scanned       : 12
  Total Imports       : 8
  Declared            : 6
  ✓ Present           : 6
  ✗ Missing           : 2
  ~ Unused declared   : 1

📋 package.json Breakdown
──────────────────────────────────────────────────
  dependencies         : 4
  devDependencies      : 2
  peerDependencies     : 0
  optionalDependencies : 0

💡 Recommendations
──────────────────────────────────────────────────
  → Run reqscan install to install 2 missing package(s).
  → Run reqscan clean   to remove 1 unused package(s).

reqscan list

📋 All Dependencies with Status
──────────────────────────────────────────────────
  ✓ axios                          ^1.6.0       present
  ✗ date-fns                                    missing
  ✓ express                        ^4.18.0      present
  ~ jest                           ^29.0.0      unused

Legend: ✓ present  ✗ missing  ~ declared but unused

🛠️ How It Works

  1. Scans all .js/.ts/.jsx/.tsx/.mjs/.cjs files (skips node_modules, dist, .next, etc.)
  2. Extracts package names from all import styles:
    • require('pkg')
    • import x from 'pkg'
    • import type { T } from 'pkg'
    • import('pkg') (dynamic)
    • require.resolve('pkg')
    • export { x } from 'pkg'
    • import 'pkg' (side-effect)
  3. Strips comments before scanning so commented-out imports are ignored
  4. Filters out Node.js built-ins (fs, path, http, node:*, etc.)
  5. Compares against package.json (all dependency types)
  6. Reports and optionally acts on findings

🔧 Programmatic API

const { scanProject } = require('reqscan');

const result = await scanProject('/path/to/project');

console.log(result.missing);      // ['axios', 'uuid']
console.log(result.present);      // ['express', 'mongoose']
console.log(result.unused);       // ['jest']
console.log(result.allImports);   // all detected package names (sorted)
console.log(result.declared);     // all declared package names (sorted)
console.log(result.scannedFiles); // list of files scanned
console.log(result.targetDir);    // resolved project directory

Return Value

| Field | Type | Description | |-------|------|-------------| | projectName | string | Name from package.json | | allImports | string[] | All unique packages found in source (sorted) | | declared | string[] | All packages in package.json (sorted) | | missing | string[] | Imported but not declared | | present | string[] | Imported AND declared | | unused | string[] | Declared but never imported | | scannedFiles | string[] | All files that were scanned | | packageJson | object\|null | Parsed package.json content | | targetDir | string | Resolved absolute path to the project root |


🧪 Running Tests

node test/test.js

🗺️ Roadmap

  • [ ] reqscan outdated — Check for newer package versions
  • [ ] reqscan upgrade — Update all outdated packages
  • [ ] Configuration file (.reqscanrc)
  • [ ] Monorepo / workspace support
  • [x] --save-dev, --dry-run, --force, --json flags (shipped in v1.1.0)

📄 License

MIT