@lowdep/codestat
v1.0.0
Published
Lines of code by language — zero-dep Node.js alternative to cloc/tokei, works on Windows
Downloads
111
Maintainers
Readme
codestat
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?
clocrequires Perltokeirequires Rust/cargosccrequires Go
codestat is a single Node.js file. If you have Node.js, you have codestat.
Install
npm install -g codestatOr without installing:
npx codestatUsage
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 alphabeticallyExample 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, .gitSupported 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.
