There are fantastic tools for coverage badges such as Coveralls but, for free, they only cover public repositories
What then if a repository is private? Bind it to a process run locally with Istanbul Readme Badges
![Process](https://res.cloudinary.com/practicaldev/image/fetch/s--hCL7blhR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2vavlvz8rtcw0a0z2x5a.gif)
One can follow the very README.md of the project but in short here is what is needed:
npm i -D istanbul-badges-readme
- A README.md file with additional markup into which the badges are inserted
| Statements | Branches | Functions | Lines |
| ------------------------- | ----------------------- | ------------------------ | -------------------- |
| ![Statements](#branches#) | ![Branches](#branches#) | ![Functions](#branches#) | ![Lines](#branches#) |
- Run the script anywhere, either in a, e.g.
pre-commit
husky hook, or in a pure NPM script directly
node_modules/.bin/istanbul-badges-readme
![Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--1EeQZAu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zegw541c78ydd30jex46.png)
Top comments (2)
It's useful, thanks for sharing
You rock, dude!