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

@mindfiredigital/monorepo-scanner

v1.0.11

Published

Monorepo scanner for analyzing packages, dependencies, and health

Readme

@mindfiredigital/monorepo-scanner

A comprehensive Node.js scanner for analyzing JavaScript/TypeScript monorepo packages, dependencies, health metrics, and Git history.

npm version License: MIT

Overview

@mindfiredigital/monorepo-scanner provides a high-level MonorepoScanner class that orchestrates full monorepo analysis. It combines package discovery, health assessments, Git metadata extraction, file type scanning, result caching, and multi-format export into a single, cohesive scanning engine.


Features

Package Discovery & Analysis

  • Automatic Package Detection: Discovers all packages across packages/, apps/, and libs/ directories by reading package.json manifests.
  • Package Type Classification: Automatically classifies each package as app, lib, or tool based on scripts and keywords.
  • Dependency Graph Construction: Maps internal workspace dependency relationships for visualization.
  • Circular Dependency Detection: Identifies and reports circular dependency chains across the entire monorepo.
  • Outdated Dependency Identification: Flags packages with potentially outdated dependencies.

Health Assessment

  • Build Status Check: Executes npm run build per package and reports success, failed, running, or unknown.
  • Test Coverage Analysis: Reads coverage reports from multiple formats (coverage-summary.json, lcov.info, clover.xml) and calculates percentage scores.
  • Lint Status Validation: Runs npm run lint per package and reports pass, fail, or unknown.
  • Security Audit Scanning: Executes pnpm audit --json to scan for known vulnerabilities and reports pass, fail, or unknown.
  • Overall Health Score: Computes a weighted score (0-100) combining build (30pts), tests (25pts), lint (25pts), and security (20pts).

Git Integration

  • Last Commit Info: Retrieves the latest commit hash, date, and author for each package.
  • Branch Detection: Identifies the current active Git branch per package.
  • Last Modified Timestamp: Reads the filesystem modification date for each package directory.

File System Scanning

  • File Type Search: Scans all packages for specific file extensions (e.g., .ts, .tsx, .json, .yaml) with automatic exclusion of node_modules, dist, build, and .git directories.

Caching

  • In-Memory Cache: Caches full scan results with a configurable 5-minute TTL to avoid redundant scans.
  • Cache Invalidation: Provides a clearCache() method for manual cache clearing.

Export & Reporting

  • JSON Export: Serializes full scan results to formatted JSON.
  • CSV Export: Generates CSV reports with package name, type, version, dependency count, and health score columns.
  • HTML Export: Produces a self-contained HTML report with styled tables and summary statistics.

Installation

pnpm add @mindfiredigital/monorepo-scanner
npm install @mindfiredigital/monorepo-scanner

Usage

import {
  quickScan,
  generateReports,
  scanForFiles,
} from '@mindfiredigital/monorepo-scanner';

// Full monorepo scan with caching
const result = await quickScan();
console.log(
  `Found ${result.packages.length} packages in ${result.scanDuration}ms`
);
console.log(`Circular dependencies: ${result.circularDependencies.length}`);

// Generate detailed per-package reports (includes health, size, git info)
const reports = await generateReports();
reports.forEach(report => {
  console.log(
    `${report.package.name}: Health Score ${report.health.overallScore}/100`
  );
});

// Scan for specific file types across all packages
const tsFiles = scanForFiles(['.ts', '.tsx']);
console.log(`Found ${tsFiles['.ts'].length} TypeScript files`);

Class-Based Usage

import { MonorepoScanner } from '@mindfiredigital/monorepo-scanner';

const scanner = new MonorepoScanner('/path/to/monorepo');

// Full scan
const result = await scanner.scan();

// Generate per-package reports
const reports = await scanner.generatePackageReports();

// Individual health checks
const buildStatus = await scanner.checkBuildStatus(result.packages[0]);
const testCoverage = await scanner.checkTestCoverage(result.packages[0]);
const lintStatus = await scanner.checkLintStatus(result.packages[0]);
const securityAudit = await scanner.checkSecurityAudit(result.packages[0]);

// Export results
const jsonReport = scanner.exportResults(result, 'json');
const csvReport = scanner.exportResults(result, 'csv');
const htmlReport = scanner.exportResults(result, 'html');

// Clear cached results
scanner.clearCache();

API Reference

MonorepoScanner Class

| Method | Returns | Description | | ------------------------------- | -------------------------- | ---------------------------------------------------- | | scan() | Promise<ScanResult> | Performs a full monorepo scan (cached for 5 minutes) | | generatePackageReports() | Promise<PackageReport[]> | Generates detailed reports for all packages | | generatePackageReport(pkg) | Promise<PackageReport> | Generates a detailed report for a single package | | checkBuildStatus(pkg) | Promise<BuildStatus> | Checks build status by running npm run build | | checkTestCoverage(pkg) | Promise<number> | Reads coverage reports and returns percentage | | checkLintStatus(pkg) | Promise<LintStatus> | Checks lint status by running npm run lint | | checkSecurityAudit(pkg) | Promise<AuditStatus> | Runs pnpm audit --json for vulnerability scanning | | scanForFileTypes(types) | Record<string, string[]> | Scans all packages for specified file extensions | | exportResults(result, format) | string | Exports scan results as json, csv, or html | | clearCache() | void | Clears the in-memory scan cache |

Convenience Functions

| Function | Description | | ------------------------- | ------------------------------------------------------------- | | quickScan() | Performs a full scan using the default scanner instance | | generateReports() | Generates reports for all packages using the default instance | | scanForFiles(fileTypes) | Scans for file types using the default instance |

Types

| Type | Description | | --------------- | ------------------------------------------------------------------------------------------------------- | | ScanResult | Full scan output (packages, stats, dependencyGraph, circularDependencies, outdatedPackages, timestamps) | | PackageReport | Per-package report (package info, health, size, outdated deps, last modified, git info) |