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

ngx-stats

v1.1.0

Published

A TypeScript-based tool for analyzing Angular projects, providing detailed counts and categorizations of components, directives, pipes, and services.

Readme

ngx-stats

Overview

ngx-stats is a CLI tool that analyzes Angular projects. It counts the number of modules, components, directives, pipes, and services — including distinctions between:

  • Standalone vs. non-standalone declarations
  • OnPush vs. Default change detection

This utility helps developers understand the structure and architectural patterns of their Angular applications.


📦 Installation

Install globally:

npm i -g ngx-stats

🚀 Usage

In any Angular project directory:

ngx-stats

image


📁 Analyze a Specific Path

ngx-stats --path path/to/angular/project

or shorthand:

ngx-stats -p ./apps/admin

🧮 Output Results in JSON

ngx-stats --json
{
  "modules": 0,
  "services": 0,
  "components": {
    "total": 4,
    "standalone": 4,
    "notStandalone": 0,
    "onPush": 2,
    "default": 2
  },
  "directives": {
    "total": 0,
    "standalone": 0,
    "notStandalone": 0
  },
  "pipes": {
    "total": 0,
    "standalone": 0,
    "notStandalone": 0
  }
}

🔙 Legacy Mode (for Angular v14–v18)

Angular v19+ treats components/directives/pipes as standalone by default.

To use legacy detection logic (standalone: true), add:

ngx-stats --legacy

or:

ngx-stats -l

🧼 Ignored Files and Folders

The following are excluded by default:

📂 Ignored directories:

  • node_modules
  • dist
  • build
  • cache
  • .nx
  • .angular
  • Any directory that starts with a .

📄 Ignored files:

  • Files ending in .stories.ts
  • Files ending in .spec.ts
  • Files ending in .d.ts

🆘 Help

ngx-stats --help

🔧 CLI Options Summary

| Option | Alias | Description | | ----------- | ----- | --------------------------------------------------------------------------- | | --path | -p | Specify target directory to scan | | --json | -j | Output result as JSON | | --legacy | -l | Use legacy detection logic (Angular v14–v18: looks for standalone: true) | | --verbose | -v | Print file paths of: NgModules, non-standalone declarations, and non-OnPush | | --help | -h | Show usage info |