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

@moojo/audit-deps

v0.7.0

Published

Dependency auditing tool that detects and fixes dependency declaration violations in TypeScript monorepos

Downloads

24

Readme

@moojo/audit-deps

npm version CI License: MIT

Dependency auditing tool that detects and fixes dependency declaration violations in TypeScript monorepos.

Installation

npm install @moojo/audit-deps

Overview

audit-deps scans module directories for anomalies between package.json declarations and actual import usage in source code. It can detect issues and optionally auto-fix them.

Features

  • Missing Dependencies: Detects packages imported in source code but not listed in package.json
  • Obsolete Dependencies: Detects packages listed in package.json but not imported anywhere
  • Self Imports: Detects when a module imports its own package name (causes compilation issues)
  • Deep Imports: Detects imports that reach into another package's internal files
  • Local File Import Extensions: Ensures local file imports include .js extension for ESM compatibility
  • Type-Only Import Handling: Properly categorizes import type statements as dev dependencies

Usage

Programmatic API

import { auditDeps } from '@moojo/audit-deps'

const result = await auditDeps(
  process.cwd(), // Starting directory
  console.log, // Print function for output
  [], // Specific paths to scan (empty = scan all)
  {
    doFix: false, // Whether to auto-fix violations
    useJson: false, // Output in JSON format
    enableJsImports: true, // Require .js extension on local imports
    resolveFromNpm: true, // Resolve missing package versions from npm
  },
)

// result is 'success' or 'err'

Violation Types

Missing Dependency

A package is imported in source code but not declared in package.json:

Missing Dependency:
   - In File: modules/a/package.json
   - Dependency: lodash
   - This dependency is imported by modules/a/src/utils.ts

Obsolete Dependency

A package is declared in package.json but never imported:

Obsolete Dependency:
   - In File: modules/a/package.json
   - Dependency: unused-lib
   - This dependency is listed but not imported by your code

Self Import

A module imports its own package name:

Self Import:
   - Location: modules/a/src/foo.ts:3:20
   - This file imports its own package (a) which blocks compilation

Deep Import

An import statement reaches into another package's internal files:

Deep Import:
   - Location: modules/a/src/a.ts:1:17
   - Import: b/src/internal
   - This import creates an implicit dependency not declared in package.json

Local File Import Extension

A local file import is missing the .js extension:

Missing .js extension in local import:
   - Location: modules/a/src/a.ts:1:17
   - Import: ./foo
   - Fix: Local file imports must include .js extension for ESM compatibility

Configuration

allowedStaleDeps

You can allow specific dependencies to remain in package.json even if they appear unused by adding an allowedStaleDeps field:

{
  "name": "my-package",
  "dependencies": {
    "runtime-loaded": "1.0.0"
  },
  "allowedStaleDeps": ["runtime-loaded"]
}

This is useful for packages that are loaded dynamically or required by build tools.

License

MIT