Count lines of code in a directory
npm install @holic512/plugin-locCount lines of code in a directory.
``bash`
slothtool install @holic512/plugin-loc
`bashCount lines in current directory
slothtool loc
Features
- Recursively scans directories
- Automatically skips
node_modules and hidden files/directories
- Handles errors gracefully (skips unreadable files)
- Supports verbose mode to show per-file statisticsOutput
`
Counting lines of code in: /path/to/directoryTotal files: 42
Total lines: 1337
`With
--verbose:`
Counting lines of code in: /path/to/directoryFiles:
/path/to/file1.js: 120 lines
/path/to/file2.js: 85 lines
...
Total files: 42
Total lines: 1337
`What Gets Counted
- All files in the target directory and subdirectories
- Excludes
node_modules/
- Excludes hidden files and directories (starting with .`)ISC