{"id":21640628,"url":"https://github.com/ppvg/node-coverage-badge","last_synced_at":"2025-04-11T16:53:09.640Z","repository":{"id":57209949,"uuid":"10741934","full_name":"ppvg/node-coverage-badge","owner":"ppvg","description":"Generate fancy code coverage badges for your node project.","archived":false,"fork":false,"pushed_at":"2015-05-26T10:04:19.000Z","size":202,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T13:01:47.398Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppvg.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":"2013-06-17T16:37:33.000Z","updated_at":"2021-11-14T16:55:32.000Z","dependencies_parsed_at":"2022-09-01T04:20:43.601Z","dependency_job_id":null,"html_url":"https://github.com/ppvg/node-coverage-badge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppvg%2Fnode-coverage-badge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppvg%2Fnode-coverage-badge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppvg%2Fnode-coverage-badge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppvg%2Fnode-coverage-badge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppvg","download_url":"https://codeload.github.com/ppvg/node-coverage-badge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248443516,"owners_count":21104441,"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-25T04:19:16.405Z","updated_at":"2025-04-11T16:53:09.620Z","avatar_url":"https://github.com/ppvg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Generate fancy code coverage badges! Does what it says on the tin. \n\n![100% coverage](https://raw.github.com/PPvG/node-coverage-badge/master/example/100.png) ![95% coverage](https://raw.github.com/PPvG/node-coverage-badge/master/example/95.png) ![85% coverage](https://raw.github.com/PPvG/node-coverage-badge/master/example/85.png)\n\nWorks like this:\n\n    $ node coverage-badge 95 coverage.png\n\n... or like this:\n\n    var fs = require('fs');\n    var badge = require('coverage-badge');\n\n    var coverage = /* read coverage from JSON or whatever */;\n    var file = fs.createWriteStream('coverage.png');\n\n    badge(coverage).pipe(file);\n\nTie it in with build tool and let your continuous integration tool call that build step and archive the image.\n\nExample\n-------\n\nAn example: [node-aether](https://github.com/PPvG/node-aether) uses Drone.io as CI server and `slake` as build tool. The relevant build step runs `jscoverage` to instrument, then runs `mocha` to generate a JSON code coverage report, and then uses that to generate the coverage badge. That last bit looks like this (rewritten from the original LiveScript):\n\n    var badge = require('coverage-badge');\n\n    task 'cov-badge', function() {\n      /* [run jscoverage...] */\n      /* [run mocha...] */\n      mocha.on('close'), function() {\n        var json = require('./coverage.json');\n        var file = fs.createWriteStream('./coverage.png');\n        badge(json.coverage).pipe(file);\n      }\n    }\n\nAt each build, Drone.io runs these commands:\n\n    sudo apt-get install jscoverage\n    slake cov-badge\n\n... and then saves `./coverage.png` as a **build artefact**. The image can then be found under the Downloads tab. The result:\n[![Code Coverage for node-aether](https://drone.io/github.com/PPvG/node-aether/files/coverage.png)](https://github.com/PPvG/node-aether)\n\nVisual theme\n------------\n\nCurrently it pretty much mimics the look of the Drone.io badge. Other styles may be added in the future.\n\nInstallation\n------------\n\n    npm install coverage-badge\n\nLicense\n-------\n\nSimplified BSD (2-clause).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppvg%2Fnode-coverage-badge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppvg%2Fnode-coverage-badge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppvg%2Fnode-coverage-badge/lists"}