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

project-stats-cli

v1.0.0

Published

Analyze project statistics: lines of code, file counts, dependencies, git stats

Readme

project-stats-cli

npm version license node

A fast, zero-config CLI tool that shows comprehensive project statistics: lines of code, file type distribution, dependency counts, git history, and largest files.

Features

  • Lines of code broken down by language with visual bars
  • File type distribution with unicode pie indicators
  • Dependency counts — production vs dev (reads package.json)
  • Git stats — commits, contributors, repo age, last commit
  • Largest files table
  • Respects .gitignore — skips node_modules, dist, lock files automatically
  • JSON output for scripting / CI pipelines
  • Beautifully colored output via chalk

Install

npm install -g project-stats-cli

Or run without installing:

npx project-stats-cli

Usage

# Analyze current directory
project-stats

# Analyze a specific path
project-stats ./src
project-stats /path/to/my/project

# Output raw JSON
project-stats --json
project-stats ./src --json

# Show help
project-stats --help

# Show version
project-stats --version

Example output

◉ Project Stats  /home/user/my-app

──────────────────────────────────────────────────────────
 Overview
──────────────────────────────────────────────────────────
  Files        142
  Lines        18,432
  Size         512.3 KB

──────────────────────────────────────────────────────────
 Lines by Language
──────────────────────────────────────────────────────────
  TypeScript  ████████████░░░░░░░░  65.2%  12,018 lines / 89 files
  JSON        ████░░░░░░░░░░░░░░░░  18.1%   3,336 lines / 12 files
  Markdown    ██░░░░░░░░░░░░░░░░░░   9.4%   1,732 lines /  8 files
  CSS         █░░░░░░░░░░░░░░░░░░░   4.2%     773 lines /  5 files
  Shell       ░░░░░░░░░░░░░░░░░░░░   3.1%     573 lines /  3 files

──────────────────────────────────────────────────────────
 File Type Distribution
──────────────────────────────────────────────────────────
  ●  TypeScript  62.7%  89 files
  ◑  JSON        8.5%   12 files
  ◔  Markdown    5.6%    8 files
  ◔  CSS         3.5%    5 files
  ◔  Shell       2.1%    3 files

──────────────────────────────────────────────────────────
 Dependencies (package.json)
──────────────────────────────────────────────────────────
  Production   12
  Dev          18
  Total        30

──────────────────────────────────────────────────────────
 Git Stats
──────────────────────────────────────────────────────────
  Branch       main
  Commits      247
  Contributors 4
  Age          182 days
  Last commit  2 hours ago

──────────────────────────────────────────────────────────
 Largest Files (by lines)
──────────────────────────────────────────────────────────
  src/components/Dashboard.tsx        1,243 lines  28.4 KB
  src/utils/parser.ts                   891 lines  18.1 KB
  ...

JSON output

Use --json to get machine-readable output:

{
  "root": "/home/user/my-app",
  "totalFiles": 142,
  "totalLines": 18432,
  "totalSize": 524595,
  "byLanguage": {
    "TypeScript": { "files": 89, "lines": 12018 }
  },
  "largestFiles": [...],
  "git": {
    "commits": 247,
    "contributors": 4,
    "ageInDays": 182,
    "branch": "main",
    "lastCommit": "2 hours ago"
  },
  "deps": {
    "prod": 12,
    "dev": 18,
    "total": 30
  }
}

Development

git clone https://github.com/okirmio-create/project-stats-cli
cd project-stats-cli
npm install
npm run build
node dist/index.js .

License

MIT © okirmio-create