sloc
« Back to VersTracker
Description:
Simple tool to count source lines of code
Type: Formula  |  Latest Version: 0.3.2@0  |  Tracked Since: Dec 24, 2025
Links: Homepage  |  GitHub  |  formulae.brew.sh
Stars: 967  |  Forks: 81  |  Language: CoffeeScript  |  Category: Developer tools
Tags: sloc loc metrics code-analysis cli
Install: brew install sloc
About:
sloc is a command-line utility that counts physical lines of source code across various programming languages. It provides a quick and straightforward way to assess project size and complexity without the overhead of more complex static analysis tools.
Key Features:
  • Supports over 150 programming and markup languages
  • Provides detailed breakdowns including physical lines, source lines, and comments
  • Zero-dependency Node.js application for easy installation and fast execution
  • Machine-readable output formats (JSON, CSV) for integration with other tools
Use Cases:
  • Quickly estimating the scope and complexity of a new codebase
  • Generating metrics for project documentation or reporting
  • Comparing code density across different languages or project versions
Alternatives:
  • cloc – cloc is written in Perl and is often pre-installed on systems, but sloc offers a lighter, Node.js-based alternative with similar functionality.
  • tokei – tokei is significantly faster and written in Rust, making it better suited for extremely large codebases, whereas sloc is simpler and sufficient for standard projects.
Version History
Detected Version Rev Change Commit
Dec 24, 2025 9:55pm 0.3.2 0 VERSION_BUMP c1c97382