Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?
like image 345
GibboK Avatar asked Oct 27 '25 06:10

GibboK


1 Answers

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.

like image 167
hashchange Avatar answered Oct 29 '25 19:10

hashchange



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!