{"id":15809220,"url":"https://github.com/zordius/badge-render","last_synced_at":"2025-03-31T23:44:45.026Z","repository":{"id":21356989,"uuid":"24674141","full_name":"zordius/badge-render","owner":"zordius","description":"A Node.js + PhantomJS based solution to generate browser testing results badge","archived":false,"fork":false,"pushed_at":"2017-09-19T02:46:57.000Z","size":544,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T03:20:19.211Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zordius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-01T10:21:28.000Z","updated_at":"2017-03-28T10:51:33.000Z","dependencies_parsed_at":"2022-08-05T11:30:32.959Z","dependency_job_id":null,"html_url":"https://github.com/zordius/badge-render","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/zordius%2Fbadge-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fbadge-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fbadge-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fbadge-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zordius","download_url":"https://codeload.github.com/zordius/badge-render/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558113,"owners_count":20796696,"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-10-05T03:20:33.876Z","updated_at":"2025-03-31T23:44:45.011Z","avatar_url":"https://github.com/zordius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"badge-render\n============\n\nA Node.js + PhantomJS based solution to generate browser testing results badge\n\nLOGO images from https://github.com/substack/browser-badge\n\n[![npm version](https://img.shields.io/npm/v/badge-render.svg)](https://www.npmjs.org/package/badge-render) [![Dependency Status](https://david-dm.org/zordius/badge-render.png)](https://david-dm.org/zordius/badge-render) [![Build Status](https://travis-ci.org/zordius/badge-render.svg?branch=master)](https://travis-ci.org/zordius/badge-render)\n\nInstall\n-------\n\n```\nnpm install badge-render\n```\n\nCommandline Usage\n-----------------\n\n**Generate your badge by badge json**\n\n```sh\nbadge-render examples/all_browsers_pass.json lib/index.html\n```\n\n* The input JSON: \u003ca href=\"examples/all_browsers_pass.json\"\u003eexamples/all_browsers_pass.json\u003c/a\u003e\n* The output HTML: \u003ca href=\"lib/index.html\"\u003elib/index.html\u003c/a\u003e\n* The output PNG: \u003cimg src=\"lib/index.html.png\" /\u003e\n\n**Options: Output png with another name**\n```sh\nbadge-render examples/all_browsers_pass.json lib/index.html --png test.png\n```\n\n**Options: Scale the html and png**\n\nThis feature is supported by updating PhantomJS zoomFactor.\n\n```sh\nbadge-render examples/all_browsers_pass.json lib/index.html --png examples/scale.png --scale 0.5\n```\n\n* The output PNG: \u003cimg src=\"examples/scale.png\" /\u003e\n\n**Options: Change the rendered image size**\n\nThis feature is supported by changing PhantomJS viewport size. Default viewport size is 500x320. When the real HTML size larger, the rendered image size will auto expanded.\n\n```sh\nbadge-render examples/all_browsers_pass.json lib/index.html --png examples/small.png --scale 0.6 --width 180 --height 200\n```\n\n* The output PNG: \u003cimg src=\"examples/small.png\" /\u003e\n\n**Options: customize the style**\n\nAppend your css file into the HTML.\n\n```sh\nbadge-render examples/all_browsers_pass.json lib/index.html --png examples/style.png --css examples/extra.css\n```\n\n* The CSS file: \u003ca href=\"examples/extra.css\"\u003eexamples/extra.css\u003c/a\u003e\n* The output PNG: \u003cimg src=\"examples/style.png\" /\u003e\n\n**Saucelabs+Travis Migration**\n\nUse this command `badge-saucelabs-results \u003e badge.json` to save your saucelabs test results. The command will use `SAUCE_USERNAME` to look for your recent tests result, and then use `TRAVIS_JOB_ID` to match your build name.\n\nIf you want to use different build name to match sauce labs results, you can try `badge-saucelabs-results YOUR_BUILD_NAME \u003e badge.json` . After the results save to badge.json, you can then render the badge by `badge-render` command.\n\nCommonJS Usage\n--------------\n\n```javascript\nvar badge = require('badge-render');\n\n// generate HTML by default handlebars template\nbadge({\n browsers: {\n   safari: {'10.0': true},\n   explorer: {'10.0': false},\n   firefox: {'10.0': true}\n }\n});\n\n// provide more options\nbadge({\n  browsers: {...},\n  title: 'change title of the html (default template)',\n  assets: 'change the assets base url (default template)',\n  template: 'template string',\n  css: 'css string for template (default template)'\n}, {\n  file: 'full path of output file',\n  hbfile: 'full path of handlebars template',\n  cssfile: 'full path of css file to customize default template'\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fbadge-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzordius%2Fbadge-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fbadge-render/lists"}