最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - How to count the total number of line of code for JS, CSS, LESS, HTML files in a project? - Stack Overflow

matteradmin6PV0评论

I am looking for a way to count the total number of line of code for my front-end project.

At the moment I am using the gulp-sloc

gulp.task('sloc', function () {
    gulp.src(folders)
      .pipe(sloc());
});

But the CSS code is not included in the count.

  • Do I miss some special configuration?
  • Do you know any other similar plugin?

I am looking for a way to count the total number of line of code for my front-end project.

At the moment I am using the gulp-sloc

gulp.task('sloc', function () {
    gulp.src(folders)
      .pipe(sloc());
});

But the CSS code is not included in the count.

  • Do I miss some special configuration?
  • Do you know any other similar plugin?
Share Improve this question asked Nov 18, 2015 at 7:46 GibboKGibboK 74k148 gold badges451 silver badges674 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

Perhaps you are using source control? In case that source control is Git, you can count the amount of code in the repo like this – no extra tools required.

For a more detailed breakdown, cloc may be helpful – have a look at this answer then. cloc doesn't depend on Git, or any other type of source control.

In windows OS there is also a gui tool http://www.locmetrics./ which you can use to count lines of code (LOC), blank lines of code (BLOC), ment lines of code (CLOC).

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far