{"id":13523840,"url":"https://github.com/simonecorsi/lcov-total","last_synced_at":"2025-04-11T23:23:54.196Z","repository":{"id":37082409,"uuid":"269063642","full_name":"simonecorsi/lcov-total","owner":"simonecorsi","description":"⚙️  Parse LCOV output and return the average value, easily fail CI with a threshold","archived":false,"fork":false,"pushed_at":"2025-04-11T16:29:22.000Z","size":2458,"stargazers_count":12,"open_issues_count":8,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T17:39:33.776Z","etag":null,"topics":["average","ci","cli","coverage","lcov","node","npm","parser","tdd","test"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/lcov-total","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonecorsi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-03T10:56:13.000Z","updated_at":"2025-04-11T16:29:20.000Z","dependencies_parsed_at":"2022-07-11T20:02:02.078Z","dependency_job_id":"698a994b-b8cb-4c45-8cc1-5ea762585de9","html_url":"https://github.com/simonecorsi/lcov-total","commit_stats":{"total_commits":358,"total_committers":6,"mean_commits":"59.666666666666664","dds":0.1843575418994413,"last_synced_commit":"abe2a65e6900e8ac7bc0a1c3da7dbf3415c5ed66"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonecorsi%2Flcov-total","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonecorsi%2Flcov-total/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonecorsi%2Flcov-total/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonecorsi%2Flcov-total/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonecorsi","download_url":"https://codeload.github.com/simonecorsi/lcov-total/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248455274,"owners_count":21106590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["average","ci","cli","coverage","lcov","node","npm","parser","tdd","test"],"created_at":"2024-08-01T06:01:04.271Z","updated_at":"2025-04-11T23:23:54.169Z","avatar_url":"https://github.com/simonecorsi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003elcov-total\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier?style=flat-square)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n![npm (scoped)](https://img.shields.io/npm/v/lcov-total?style=flat-square)\n![license](https://img.shields.io/github/license/simonecorsi/lcov-total)\n\n\u003c/div\u003e\n\n## Table of contents\n\n\u003c!-- toc --\u003e\n\n- [About](#about)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n- [Acknowledgements](#acknowledgements)\n\n\u003c!-- tocstop --\u003e\n\n## About\n\n\u003e This module now uses ESM modules from `v2.0.0`, if you need to use CommonJS refer to `v1.x.x`\n\nThis 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.\n\nHere's why:\n\n- You need to assest coverage in your CI and fail below certain threshold\n- you don't want to do unredable `awk` chains\n- every other options outputs fancy colored output which is tediuous to parse and error prone\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Installation\n\nYou can install locally\n\n```sh\nnpm install lcov-total\n```\n\nYou can install globally\n\n```sh\nnpm install -g lcov-total\n```\n\nOr use NPX\n\n```sh\nnpx lcov-total\n```\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n## Usage\n\nYou can use `lcov-total` from command line providing `lcov.info` file location eg:\n\n```sh\nnpx lcov-total lcov.info\n# 100.00\n```\n\nIf you pass the `--gte=value` flag you will get an exitCode 0 or 1 based on resulting `coverage \u003e= value` expression, eg:\n\n```sh\nnpx lcov-total lcov.info --gte=90\necho $?\n# 0\n```\n\nOr programmatically\n\n```js\nimport lcovTotal from \"lcov-total\";\nlcovTotal(\"/path/to/lcov.info\"); // this throws if any error\n```\n\n\u003c!-- CONTRIBUTING --\u003e\n\n## Contributing\n\nProject is pretty simple and straight forward for what is my needs, but if you have any idea you're welcome.\n\nThis projects uses [commitlint](https://commitlint.js.org/) with Angular configuration so be sure to use standard commit format or PR won't be accepted.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'feat(scope): some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\nDistributed under the MIT License. See [`LICENSE`](./LICENSE) for more information.\n\n\u003c!-- CONTACT --\u003e\n\n## Contact\n\nSimone Corsi - [@im_simonecorsi](https://twitter.com/im_simonecorsi)\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n\n## Acknowledgements\n\n- [lcov parsing mega switch](https://github.com/davglass/lcov-parse) - from davglass\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonecorsi%2Flcov-total","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonecorsi%2Flcov-total","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonecorsi%2Flcov-total/lists"}