Socket
Socket
Sign inDemoInstall

lcov-total

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lcov-total

Parsing lcov.info and returning total of the summary intended to use inside CI to exit if threshold not reach


Version published
Maintainers
1
Created

Changelog

Source

<small>1.0.7 (2021-01-23)</small>

  • chore(release): 1.0.7 (b42e1af)
  • build(deps): bump ini from 1.3.5 to 1.3.8 (f935493)

Readme

Source

lcov-average

Node.js CI

About The Project

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:

  • You need to assest coverage in your CI and fail below certain threshold
  • you don't want to do unredable awk chains
  • every other options outputs fancy colored output which is tediuous to parse and error prone

Installation

You can install locally

npm install lcov-total

You can install glocally

npm install -g lcov-total

Or use NPX

npx lcov-total

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

const lcovTotal = require("lcov-total");
lcovTotal("/path/to/lcov.info"); // this throws if any error

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 commitizen 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

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

Contact

Simone Corsi - @im_simonecorsi

Acknowledgements

Keywords

FAQs

Last updated on 15 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc