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

codemeter

v0.0.3

Published

A CLI tool for code analysis. Counts lines and files

Downloads

127

Readme

CodeMeter 📊

A powerful and user-friendly CLI tool for analyzing code statistics. Count lines of code, files, and get detailed breakdowns by programming language.

CodeMeter

Features ✨

  • 📈 Detailed Statistics: Count lines of code and files by language
  • 🎨 Beautiful Output: Colorized tables with percentages and formatting
  • 🚀 Fast & Efficient: Optimized for large codebases
  • 📊 Progress Indicators: Visual progress bar for long-running scans
  • 🔍 Smart Filtering: Automatic support for .gitignore and .codemeterignore
  • 📝 Multiple Formats: Output as table or JSON
  • 💾 Export Results: Save output to files
  • 🌈 Language Detection: Recognizes 50+ programming languages

Installation

npm install -g codemeter

Usage

Basic Usage

Analyze the current directory:

codemeter

Or specify a directory:

codemeter src

Skip Directories

Skip specific directories using the --skip-dir option:

codemeter . --skip-dir node_modules .git dist

Skip File Extensions

Skip files by their extension using the --skip-ext option:

codemeter . --skip-ext log txt md

You can combine with directory skipping:

codemeter . --skip-dir node_modules --skip-ext log txt

Show Progress

For large projects, use the progress bar:

codemeter . --progress

Output Formats

Table format (default):

codemeter . --format table

JSON format:

codemeter . --format json

Save to File

Save results to a file:

codemeter . --output report.txt
codemeter . --format json --output report.json

Ignore .gitignore

By default, CodeMeter respects .gitignore files. To disable this:

codemeter . --no-gitignore

Verbose Mode

Show detailed information about the analysis:

codemeter . --verbose

Options

| Option | Short | Description | |--------|-------|-------------| | --skip-dir <dirs...> | -s | Directories to skip (space-separated) | | --skip-ext <exts...> | -e | File extensions to skip (space-separated, e.g., --skip-ext log txt) | | --progress | -p | Show progress bar while scanning | | --format <format> | -f | Output format: table (default) or json | | --output <file> | -o | Save output to a file | | --no-gitignore | | Don't use .gitignore and .codemeterignore files | | --verbose | | Show verbose output | | --version | -v | Display version number | | --help | -h | Display help information |

Ignore Files

.gitignore Support

CodeMeter automatically respects .gitignore files in your project. Files and directories listed in .gitignore will be excluded from analysis.

.codemeterignore

Create a .codemeterignore file in your project root to specify additional files or patterns to exclude. This file uses the same syntax as .gitignore.

Example .codemeterignore:

# Exclude test files
**/*.test.js
**/*.spec.js

# Exclude generated files
**/generated/
**/*.min.js

# Exclude documentation
docs/
*.md

Output Examples

Table Output

┌─────────────────────────┬──────────┬───────────────┬────────┐
│ Language                │ Files    │ Lines         │ %      │
├─────────────────────────┼──────────┼───────────────┼────────┤
│ JavaScript (.js)        │ 45       │ 12,345        │ 45.2%  │
│ TypeScript (.ts)        │ 23       │ 8,901         │ 32.6%  │
│ CSS (.css)              │ 12       │ 2,456         │ 9.0%   │
│ HTML (.html)            │ 8        │ 1,234         │ 4.5%   │
│ JSON (.json)            │ 15       │ 2,345         │ 8.6%   │
├─────────────────────────┼──────────┼───────────────┼────────┤
│ TOTAL                   │ 103      │ 27,281        │ 100.0% │
└─────────────────────────┴──────────┴───────────────┴────────┘

JSON Output

{
  "languages": [
    {
      "extension": "js",
      "language": "JavaScript",
      "files": 45,
      "lines": 12345,
      "percentage": "45.23"
    },
    ...
  ],
  "totals": {
    "files": 103,
    "lines": 27281
  }
}

Supported Languages

CodeMeter recognizes 50+ programming languages including:

  • JavaScript/TypeScript (JS, TS, JSX, TSX)
  • Python, Java, C/C++, C#, Go, Rust
  • PHP, Ruby, Swift, Kotlin
  • HTML, CSS, SCSS, Sass, Less
  • Shell scripts (Bash, Zsh, Fish)
  • Configuration files (JSON, YAML, XML, TOML)
  • And many more...

Examples

Analyze a React Project

codemeter . --skip-dir node_modules .next --progress

Generate JSON Report

codemeter . --format json --output code-stats.json

Analyze with Custom Ignores

codemeter . --skip-dir node_modules dist build --no-gitignore

Skip Specific File Types

codemeter . --skip-ext log txt md json

Quick Analysis

codemeter src --verbose

Tips 💡

  1. Use progress bar for large projects: Add --progress when analyzing large codebases
  2. Create .codemeterignore: Use it to exclude test files, generated code, or documentation
  3. JSON format for automation: Use --format json for programmatic access to results
  4. Combine options: Mix and match options for your specific needs

Requirements

  • Node.js >= 16

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Author

Kritebh Lagan Bibhakar