{"id":37807090,"url":"https://github.com/addityasingh/istanbul-coverage-enforcer","last_synced_at":"2026-01-16T15:31:05.834Z","repository":{"id":29662827,"uuid":"122407212","full_name":"addityasingh/istanbul-coverage-enforcer","owner":"addityasingh","description":"A Nodejs package and cli tool to enforce code coverage","archived":false,"fork":false,"pushed_at":"2022-12-07T10:42:12.000Z","size":529,"stargazers_count":1,"open_issues_count":22,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T07:48:08.599Z","etag":null,"topics":["code-coverage","coverage-enforce","istanbul","nodejs"],"latest_commit_sha":null,"homepage":null,"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/addityasingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-21T23:32:16.000Z","updated_at":"2020-01-05T23:43:06.000Z","dependencies_parsed_at":"2023-01-14T15:30:29.438Z","dependency_job_id":null,"html_url":"https://github.com/addityasingh/istanbul-coverage-enforcer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/addityasingh/istanbul-coverage-enforcer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fistanbul-coverage-enforcer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fistanbul-coverage-enforcer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fistanbul-coverage-enforcer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fistanbul-coverage-enforcer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/addityasingh","download_url":"https://codeload.github.com/addityasingh/istanbul-coverage-enforcer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fistanbul-coverage-enforcer/sbom","scorecard":{"id":165985,"data":{"date":"2025-08-11","repo":{"name":"github.com/addityasingh/istanbul-coverage-enforcer","commit":"dbb989f830de10bb53ed9250a5e618a8b4891c6e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"70 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-mh2h-6j8q-x246","Warn: Project is vulnerable to: GHSA-5q88-cjfq-g2mh","Warn: Project is vulnerable to: GHSA-xp63-6vf5-xf3v","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T14:52:33.595Z","repository_id":29662827,"created_at":"2025-08-16T14:52:33.595Z","updated_at":"2025-08-16T14:52:33.595Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["code-coverage","coverage-enforce","istanbul","nodejs"],"created_at":"2026-01-16T15:31:03.922Z","updated_at":"2026-01-16T15:31:05.166Z","avatar_url":"https://github.com/addityasingh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# istanbul-coverage-enforcer\nA Nodejs package and cli tool to enforce global code coverage\n\n[![NPM](https://nodei.co/npm/istanbul-coverage-enforcer.png)](https://npmjs.org/package/istanbul-coverage-enforcer)\n\n## Build status\n[![Build Status](https://travis-ci.org/addityasingh/istanbul-coverage-enforcer.svg?branch=master)](https://travis-ci.org/addityasingh/istanbul-coverage-enforcer)\n[![coverage](https://codecov.io/github/addityasingh/istanbul-coverage-enforcer/coverage.svg?precision=0)](https://codecov.io/github/addityasingh/istanbul-coverage-enforcer)\n\n## npm status\n[![downloads](https://img.shields.io/npm/dt/istanbul-coverage-enforcer.svg)](https://npmjs.org/package/istanbul-coverage-enforcer)\n[![version](https://img.shields.io/npm/v/istanbul-coverage-enforcer.svg)](https://npmjs.org/package/istanbul-coverage-enforcer)\n\n\n### Why?\nMost of the coverage tools available do not provide an option to enforce the coverage and flag exception in case the coverage threshold is not met. This is one of the very frequently faced use cases I came across for most applications I work along with other team members. Due to struct deadlines we tend to miss out on tests and manually enforcing the test coverage to be maintained is not a scalable option.\n\nThis package solves the issue of manually maintaning the global code coverage above a given threshold\n\n# Installation\nUse it with `npm` as\n\n```\nnpm install istanbul-coverage-enforcer\n```\n\nor with yarn as \n\n```\nyarn add istanbul-coverage-enforcer\n```\n\n# Prerequisite\nistanbul stable (`0.4.5` or below) is needed to get the [required interface](http://gotwarlost.github.io/istanbul/public/apidocs/classes/Istanbul.html) of the `coverage.json` file\n\n# Usage\nYou can use the istanbul-coverage-enforcer both as a node package and as a CLI tool\n\n#### As a CLI tool:\nThese are the options available currently with the CLI tool\n\n```\nenforce --help\n\n  Usage: enforce [options]\n\n\n  Options:\n\n    -c, --coverage-path   The path to coverage JSON file\n    -t, --threshold-path  The path to the threshold JSON file\n    -h, --help            output usage information\n```\n\n1. Add a npm script in `package.json` to call the package with the path to the code-coverage file. By default this is at `coverage/coverage.json` \n\n```javascript\n\"enforce-coverage\": \"enforce -c coverage/coverage.json -t coverage-threshold.json\",\n```\n\n2. Now you can run this script as part of your build to ensure that code coverage is maintained above threshold\n```\nnpm run enforce-covergage\n```\n***Output***\n![istanbul-enforce-success](https://raw.githubusercontent.com/addityasingh/istanbul-coverage-enforcer/master/examples/cli/images/istanbul-enforce-success.png)\n\n![istanbul-enforce-failure](https://raw.githubusercontent.com/addityasingh/istanbul-coverage-enforcer/master/examples/cli/images/istanbul-enforce-failure.png)\n\n#### As a node package\n1. Create a `coverage-threshold.json` in the root of your project. Optionally this can be also passed as the second parameter to the function\n\n2. In your script *import* and *call* the `enforce` function as below:\n```\nconst enforce = require('../index');\n\nenforce('./examples/packages/coverage.json', './examples/packages/coverage-threshold.json');\n```\n\nRefer the [examples](https://github.com/addityasingh/istanbul-coverage-enforcer/tree/master/examples) folder for basic use case examples as node package and cli\n\n# Reference and Credits\n[istanbul-threshold-checker](https://github.com/peterjwest/istanbul-threshold-checker) for getting the grunt work to compare and generate the result\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddityasingh%2Fistanbul-coverage-enforcer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddityasingh%2Fistanbul-coverage-enforcer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddityasingh%2Fistanbul-coverage-enforcer/lists"}