{"id":19440146,"url":"https://github.com/jehy/runtime-coverage","last_synced_at":"2025-10-14T08:32:15.804Z","repository":{"id":65492045,"uuid":"240313276","full_name":"jehy/runtime-coverage","owner":"jehy","description":"Enable coverage any time after service startup, gather coverage and disable it!","archived":false,"fork":false,"pushed_at":"2020-02-19T06:58:31.000Z","size":57,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-14T08:32:00.829Z","etag":null,"topics":["coverage","coverage-data","node","nodejs","v8"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jehy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-13T16:56:32.000Z","updated_at":"2025-02-14T09:11:52.000Z","dependencies_parsed_at":"2023-01-25T19:25:13.546Z","dependency_job_id":null,"html_url":"https://github.com/jehy/runtime-coverage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jehy/runtime-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jehy%2Fruntime-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jehy%2Fruntime-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jehy%2Fruntime-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jehy%2Fruntime-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jehy","download_url":"https://codeload.github.com/jehy/runtime-coverage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jehy%2Fruntime-coverage/sbom","scorecard":{"id":514562,"data":{"date":"2025-08-11","repo":{"name":"github.com/jehy/runtime-coverage","commit":"0a8430fb959a7a3aaf35f5009faea66e2432b667"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 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":"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":"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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 7 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"}}]},"last_synced_at":"2025-08-20T01:28:24.725Z","repository_id":65492045,"created_at":"2025-08-20T01:28:24.725Z","updated_at":"2025-08-20T01:28:24.725Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018311,"owners_count":26086342,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["coverage","coverage-data","node","nodejs","v8"],"created_at":"2024-11-10T15:28:09.361Z","updated_at":"2025-10-14T08:32:15.770Z","avatar_url":"https://github.com/jehy.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.com/jehy/runtime-coverage.svg?branch=master)](https://travis-ci.com/jehy/runtime-coverage) [![npm version](https://badge.fury.io/js/runtime-coverage.svg)](https://badge.fury.io/js/runtime-coverage)\n[![dependencies Status](https://david-dm.org/jehy/runtime-coverage/status.svg)](https://david-dm.org/jehy/runtime-coverage)\n[![devDependencies Status](https://david-dm.org/jehy/runtime-coverage/dev-status.svg)](https://david-dm.org/jehy/runtime-coverage?type=dev)\n[![Known Vulnerabilities](https://snyk.io/test/github/jehy/runtime-coverage/badge.svg)](https://snyk.io/test/github/jehy/runtime-coverage)\n[![Coverage Status](https://coveralls.io/repos/github/jehy/runtime-coverage/badge.svg?branch=master)](https://coveralls.io/github/jehy/runtime-coverage?branch=master)\n\n# Runtime coverage\n\nEnable coverage any time after service startup, gather coverage and disable it!\n\nUseful for integration tests and checking for dead code branches.\n\n## Usage\n\n### Install\n\n```bash\n\nnpm install runtime-coverage\n\n```\n\n### Start coverage\n\n```js\n\nconst runtimeCoverage = require('runtime-coverage');\nawait runtimeCoverage.startCoverage();\n\n```\n\n### Gather and output coverage\n\n```js\n\nconst options = {\n  reporters: ['text'],\n  return: true,\n  all: true,\n  exclude: ['**/node_modules/**'],\n  };\nconst res = await runtimeCoverage.getCoverage(options);\nconsole.log(res.text);\n\n```\n\nYou can also get coverage in any format of istanbul reporters, for example cobertura.\n\n### Options\n\nOptions for `getCoverage`:\n\n * `{Object} options` options for getting coverage\n * `{Array} [options.exclude]` exclude those files in coverage, [micromatch](https://github.com/micromatch/micromatch) array, default `**/node_modules/**`\n * `{string} [options.rootDir]` starting directory for files that need coverage info, default `process.env.PWD`\n * `{boolean} [options.all]` include files which were not used in coverage data, default `false`\n * `{boolean} [options.deleteCoverage]` delete coverage directory after output, default `true`\n * `{string} [options.coverageDirectory]` Directory for storing coverage, defaults to temporary directory\n * `{boolean} [options.return]` return coverage data, default `true`.\n * `{boolean} [options.stream]` return coverage data as a stream, useful for huge coverage data,  default `false`\n * `{boolean} [options.streamTimeout]` destroy stream if not used after this timeout,  default `60*1000` millis\n * `{Array} [options.reporters]` Array of reporters to use, default \"text\", see all possible [here](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib).\n\nif `return` option is true, result will be an object with coverage data, keys are reporters's\nnames. For example, for `text` reporter result will be in `res.text`, for `cobertura` it\nwill be `res.cobertura` and so on.\n\nif `stream` option is true, object will have same structure, but instead of data there\nwill be a stream, which will be destroyed after `streamTimeout` if not used.\n\n### Sample\n\nShort express sample [here](https://github.com/jehy/runtime-coverage-sample).\n\n### Beware\n\nAfter first module call, in subsequent calls V8 only reports partial coverage for called\nfunctions, and it leads to 100% module coverage. To avoid it, either:\n* Call all your code after `startCoverage()` call\n* Use option `forceLineMode` -  it can only help with line coverage and is approximate because\ncan't know about comments, empty lines and statements - but it's safe\n* Use option `forceReload` (used by default) - it will try to safely reload and run your file. But\nthinks may break, kitten may die, and devil may be summoned - I warned you!\n\nV8 coverage is still experimental, so of cause some thing are pretty clumsy.\nI'm still hoping to make a perfect runtime coverage - may be with help of istanbul metadata. Wanna help?\n\n### Debug\n\nIf you wanna debug library work, launch your project with env variable\n`DEBUG=runtime-coverage:* `\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjehy%2Fruntime-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjehy%2Fruntime-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjehy%2Fruntime-coverage/lists"}