{"id":19841275,"url":"https://github.com/codelenny/1pct","last_synced_at":"2026-06-04T20:30:58.353Z","repository":{"id":57103075,"uuid":"97761014","full_name":"CodeLenny/1pct","owner":"CodeLenny","description":"Summarize Istanbul Coverage","archived":false,"fork":false,"pushed_at":"2017-07-23T18:24:00.000Z","size":71,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T13:41:58.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CodeLenny.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":"2017-07-19T21:03:25.000Z","updated_at":"2017-07-23T16:55:52.000Z","dependencies_parsed_at":"2022-08-20T20:40:25.041Z","dependency_job_id":null,"html_url":"https://github.com/CodeLenny/1pct","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeLenny%2F1pct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeLenny%2F1pct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeLenny%2F1pct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeLenny%2F1pct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeLenny","download_url":"https://codeload.github.com/CodeLenny/1pct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241210626,"owners_count":19927816,"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":[],"created_at":"2024-11-12T12:29:52.372Z","updated_at":"2026-06-04T20:30:58.313Z","avatar_url":"https://github.com/CodeLenny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1%: Summarize Istanbul Coverage\n\n[![1% on NPM](https://img.shields.io/npm/v/@codelenny/1pct.svg)](https://npm.im/@codelenny/1pct)\n[![Build Status](https://travis-ci.org/CodeLenny/1pct.svg?branch=master)](https://travis-ci.org/CodeLenny/1pct)\n\nRunning tests through Istanbul produces separate percentages for statements, branches, functions, and lines:\n\n```sh\n$(npm bin)/nyc (ava|mocha|...)\n# ----------------------------|----------|----------|----------|----------|----------------|\n# File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n# ----------------------------|----------|----------|----------|----------|----------------|\n# All files                   |    50.00 |        - |       -  |    90.00 |                |\n# ...\n# ----------------------------|----------|----------|----------|----------|----------------|\n```\n\nUse 1% to merge each coverage metric into a single percentage.  For instance, 2/4 statements (50% statement coverage)\nand 9/10 lines (90% line coverage) would become 79% total coverage (calculated using `(2+9)/(4+10)`).\n\n### Installation\n\n```sh\nnpm install --save-dev @codelenny/1pct\n```\n\n### Usage\n\nRun your tests normally:\n\n```sh\n$(npm bin)/nyc (ava|mocha|...)\n# ----------------------------|----------|----------|----------|----------|----------------|\n# File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n# ----------------------------|----------|----------|----------|----------|----------------|\n# All files                   |    50.00 |        - |       -  |    90.00 |                |\n# ...\n# ----------------------------|----------|----------|----------|----------|----------------|\n```\n\nGenerate a JSON coverage summary for 1%:\n\n```sh\n$(npm bin)/nyc report --reporter=json-summary\n```\n\nRun 1% to summarize the total coverage:\n\n```sh\n$(npm bin)/1%\n# statements: Covered 2 out of 4 total (50%)\n# ...\n# lines: Covered 9 out of 10 total (90%)\nTotal coverage metrics: 11/14\nTotal coverage: 78.57%\n```\n\nIf you're using GitLab CI or another platform that extracts the coverage percentage from the log output, you can use the\nfollowing regular expression to filter the total coverage:\n\n```regex\n/Total coverage: ([0-9]{1,3}\\.[0-9]{2})\\%/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelenny%2F1pct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelenny%2F1pct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelenny%2F1pct/lists"}