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

@ferrow/dependency-checker

v1.0.0

Published

Offline package.json analyzer for loose versions, duplicates, and invalid semver

Readme

dependency-checker

CI

Offline static analyzer for package.json. Detects loose version ranges (*, latest), duplicate dependencies, invalid semver, non-npm specifiers (git/file/http), and engine misconfigurations. Works without network.

Quickstart

import { DependencyChecker } from 'dependency-checker';

const checker = new DependencyChecker();

const result = await checker.analyze({
  dependencies: {
    'lodash': '*',           // Too loose
    'axios': '^1.0.0',       // OK
    'mypkg': 'git+https://...' // Non-npm
  },
  devDependencies: {
    'lodash': '^4.0.0',      // Duplicate!
    'jest': '^29.0.0'        // OK
  }
});

console.log(result.issues);
// [
//   { severity: 'warning', category: 'loose-version', package: 'lodash', message: '...' },
//   { severity: 'warning', category: 'duplicate-dep', package: 'lodash', message: '...' },
//   { severity: 'warning', category: 'non-npm-specifier', package: 'mypkg', message: '...' }
// ]

API

Constructor

new DependencyChecker(fetchFn?: (url: string) => Promise<any>)

Optional fetchFn enables online checks (e.g., fetch latest versions from npm registry). If omitted, only offline analysis runs.

Methods

analyze(packageJson)

Analyze package.json structure and return issues.

const result = await checker.analyze(packageJson);

Returns:

{
  total: number;           // Unique packages across all dep types
  direct: number;          // Count of dependencies
  dev: number;             // Count of devDependencies
  peer: number;            // Count of peerDependencies
  issues: Issue[];         // Detected problems
}

Issue Categories

  • loose-version (warning) — Version is * or latest
  • non-npm-specifier (warning) — Version is git/file/http URL
  • invalid-semver (warning) — Range doesn't parse as valid semver
  • duplicate-dep (warning) — Package in both deps and devDeps
  • loose-min-version (info) — Min version like >=1 without patch
  • engines (info) — Invalid Node.js engine specification

Scope & Limits

  • Offline by default — no network calls unless fetch is provided
  • Static analysis only — doesn't install or validate actual versions
  • Package.json structure only — doesn't examine lock files or installed packages
  • Basic semver validation — recognizes common patterns; complex ranges may report false positives
  • No vulnerability data — doesn't check npm advisory database
  • No update suggestions — reports issues, not "consider upgrading to X"

Example: Synthetic Package.json

const pkg = {
  dependencies: {
    'express': '^4.18.0',
    'lodash': '*',
    'custom': 'git+https://github.com/example/custom.git'
  },
  devDependencies: {
    'lodash': '4.17.x',      // Duplicate in deps
    '@types/node': '^20.0.0',
    'jest': 'latest'         // Too loose
  },
  peerDependencies: {
    'react': '^18.0.0'
  },
  engines: {
    'node': '>=18'
  }
};

const result = await checker.analyze(pkg);
console.log(`Issues: ${result.issues.length}`); // 4
console.log(`Total packages: ${result.total}`);  // 6

License

MIT


Sponsored by Ferrow


Part of the ferrow-toolkit collection · Sponsored by Ferrow