Counting lines of code with cloc - Linux Tutorials - Learn Linux Configuration

Are you working on a project and need to submit your progress, statistics or perhaps you need to calculate a value of your code? cloc is a powerful tool that allows you to count all lines of your code, exclude comment lines and white space and even sort it by programming language.


This is a companion discussion topic for the original entry at https://linuxconfig.org/counting-lines-of-code-with-cloc

The new kid on the block, or perhaps I should say, the new bid on the Cloc, is Loci. Available as an npm package, it is faster than Cloc at scale with native threading. It is Node 16 compatible so it will run on all node-supported environments. It’s new, but has advanced integration features. You can develop your own project around it, embed it in your DevOps pipeline with environment variable-driven configuration, or use it as a node CLI tool.