Find out how many lines of code you have written for your project.
(Install the package globally)
npm install -g tloc
The tloc
command can be used to calculate the number of lines of code by providing the location of the file or folder. Some additional options and flags that can be used:
-
-l
or--log
: Adding some additional information to the console. -
--
: Ignoring files/directories (This option must be used at the last)
# path to folder
tloc ./src
# path to file
tloc ./src/index.ts
tloc ./src -l
# or
tloc ./src --log
# Remove particular file or directory
tloc ./src -- ./src/dummyData.js ./temp
# Remove all matching occurences
tloc ./src -- dummyData.js temp
# While using other options, use the ignore option at last
tloc ./src -l -- dummyData.js ./temp
- Calculates the number of lines in each file by recursively moving through the directories.
- Ignore specific files/directories or all matching occurrences.
- Implemented using
Depth First Search (DFS)
algorithm.
-
Clone the repo to your local machine.
-
Install the required dependency using:
npm install
-
Build the package using:
npm run build
Varun Kumar Tiwari LinkedIn Github |
(If you liked the project, give it star π)