Skip to content

Rushabh5000/codestat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codestat

Zero dependencies Node License: MIT Platform

Lines of code by language — zero-dependency Node.js alternative to cloc, tokei, and scc.

Counts code lines, comment lines, and blank lines per language. Works on Windows, Mac, and Linux with a single npx codestat.


Why?

  • cloc requires Perl
  • tokei requires Rust/cargo
  • scc requires Go

codestat is a single Node.js file. If you have Node.js, you have codestat.


Install

npm install -g codestat

Or without installing:

npx codestat

Usage

codestat                   # Current directory
codestat ./src             # Specific directory
codestat --json            # JSON output
codestat --sort files      # Sort by file count instead of code lines
codestat --sort name       # Sort alphabetically

Example Output

codestat  my-app

  Language          Files      Code    Comment    Blank      Total
  ──────────────────────────────────────────────────────────────────────────
  TypeScript           84     8,234        412      892      9,538  ████████████████
  CSS                  12     2,105         67      341      2,513  █████░░░░░░░░░░░
  JavaScript            8     1,204        189      223      1,616  ███░░░░░░░░░░░░░
  HTML                  6       456          0       89        545  █░░░░░░░░░░░░░░░
  YAML                  4       112         34       28        174  ░░░░░░░░░░░░░░░░
  Markdown              3         0          0      210        210  ░░░░░░░░░░░░░░░░
  JSON                  2       198          0        0        198  ░░░░░░░░░░░░░░░░
  ──────────────────────────────────────────────────────────────────────────
  TOTAL               119    12,309        702    1,783     14,794

  7 language(s) · skipped: node_modules, dist, build, .git

Supported Languages (36+)

TypeScript, JavaScript, Python, Rust, Go, Java, C/C++, C#, PHP, Ruby, Swift, Kotlin, Shell, CSS, SCSS/Sass, Less, HTML, Vue, Svelte, JSON, YAML, TOML, Markdown, SQL, GraphQL, Dockerfile, Makefile, Terraform, Lua, Dart, R, Elixir, Erlang, Haskell, Scala, Text


Skipped Automatically

node_modules, .git, dist, build, out, .next, coverage, __pycache__, vendor, venv, target


JSON Output

codestat --json
{
  "directory": "/path/to/project",
  "summary": {
    "files": 119,
    "code": 12309,
    "comments": 702,
    "blank": 1783,
    "total": 14794
  },
  "languages": [
    {
      "name": "TypeScript",
      "files": 84,
      "code": 8234,
      "comments": 412,
      "blank": 892,
      "total": 9538
    }
  ]
}

License

MIT


Keywords

lines of code · loc counter · cloc alternative · tokei alternative · scc alternative · code statistics · count lines · sloc · zero dependencies · cross-platform


Scan your dependencies for free

This tool has zero dependencies by design — but your other projects might not be so lean. DepWarden scans any package.json, pom.xml, requirements.txt, go.mod, or lockfile for vulnerabilities, licence issues, and supply-chain risks. Anonymous, no account needed, results in seconds.


Support & Feedback

Found a bug or have a suggestion? Email hello@depwarden.in or raise a support ticket.


Built to solve, shared to help — Rushabh Shah 🛠️✨

One of 40+ zero-dependency developer CLI tools — no node_modules, ever.

Releases

No releases published

Packages

 
 
 

Contributors