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

@lowdep/codestat

v1.0.0

Published

Lines of code by language — zero-dep Node.js alternative to cloc/tokei, works on Windows

Downloads

111

Readme

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


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

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