Home

Awesome

<h1 align="center">lcov-total</h1> <div align="center">

code style: prettier semantic-release npm (scoped) license

</div>

Table of contents

<!-- toc --> <!-- tocstop -->

About

This module now uses ESM modules from v2.0.0, if you need to use CommonJS refer to v1.x.x

This simple package aim to parse lcov.info files and provide the total coverage Number without fancy formatting or anything else, either in stdout or programmatically.

Here's why:

<!-- GETTING STARTED -->

Installation

You can install locally

npm install lcov-total

You can install globally

npm install -g lcov-total

Or use NPX

npx lcov-total
<!-- USAGE EXAMPLES -->

Usage

You can use lcov-total from command line providing lcov.info file location eg:

npx lcov-total lcov.info
# 100.00

If you pass the --gte=value flag you will get an exitCode 0 or 1 based on resulting coverage >= value expression, eg:

npx lcov-total lcov.info --gte=90
echo $?
# 0

Or programmatically

import lcovTotal from "lcov-total";
lcovTotal("/path/to/lcov.info"); // this throws if any error
<!-- CONTRIBUTING -->

Contributing

Project is pretty simple and straight forward for what is my needs, but if you have any idea you're welcome.

This projects uses commitlint with Angular configuration so be sure to use standard commit format or PR won't be accepted.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat(scope): some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
<!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE for more information.

<!-- CONTACT -->

Contact

Simone Corsi - @im_simonecorsi

<!-- ACKNOWLEDGEMENTS -->

Acknowledgements