list-files-by-lines
v1.0.2
Published
Utility to sort files by number of lines in them. Useful in traversing through larger codebase and refactoring.
Downloads
13
Readme
list-files-by-lines
A utility to sort files by the number of lines they contain. Useful for traversing through larger codebases and refactoring.
Installation
Install globally using npm:
npm install -g list-files-by-lines
Usage
Run the command in your project directory:
list-files-by-lines [options]
Options
-d, --directory <path>
: Specify the directory to scan (default: current directory)-e, --exclude <pattern>
: Exclude files/directories matching the pattern (can be used multiple times)-m, --min-lines <number>
: Show only files with at least this many lines-s, --sort <asc|desc>
: Sort order (default: desc)
Examples
List all files in the current directory, sorted by line count (descending):
list-files-by-lines
Scan a specific directory:
list-files-by-lines -d /path/to/project
Exclude node_modules and test files:
list-files-by-lines -e node_modules -e *.test.js
Show only files with at least 100 lines:
list-files-by-lines -m 100
Sort in ascending order:
list-files-by-lines -s asc
License
ISC
Author
Narveer Rathore @narveer-rathore