Adding Dynamic Lines-of-Code and File Count Badges to your Github/Gitlab Repositories

in programming •  7 years ago 

When publishing my open source projects, I often want to give potential users or contributors an idea of the project's scope and complexity of the codebase. Although not perfect, Lines of Code (LoC) can often be a good metric for determining this.

Tokei is a written in Rust that counts lines of code very fast. They host a web-service that automatically generates badges for Github and Gitlab repositories showing these statistics.

Using Tokei in Your Repositories

Using the Tokei badge service couldn't be easier: Simply add a small link to your project's README.md file and reload the page!

The snippet looks like this: ![](https://tokei.rs/b1/github/Ameobea/cryptoviz)

Replace github with gitlab if you're using that, replace Ameobea with your Github/Gitlab username, and replace cryptoviz with whatever your repository is named. That will automatically generate and display the small LoC badge.

If you want to view the file count as well, Use this snippet: ![](https://tokei.rs/b1/github/Ameobea/cryptoviz?category=files), making the same replacements as the first snippet. Additional categories that are available include code (default), blanks, comments, and lines(total of code, comments, and blanks).


I've made a habit out of using Tokei on all of my open-source repositories. Besides being a cool way to track your progress and view some simple stats about your own work, it helps others who many be interested in your work as well!

Check out the Tokei Repository to learn more about the cool tool or install the CLI version!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @ameo! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!
  ·  7 years ago Reveal Comment