Skip to content
generate browser version compatibility badges
JavaScript
Latest commit 3332071 Apr 15, 2014 @substack 1.1.3 actually
Failed to load latest commit information.
bin exit code on failure Aug 21, 2012
example android-chrome vs android-browser Apr 24, 2013
static upgrade canvas Jan 19, 2014
LICENSE package.json etc Aug 21, 2012
index.js pending status Mar 14, 2013
package.json 1.1.3 actually Apr 15, 2014
readme.markdown pending status Mar 14, 2013

readme.markdown

browser-badge

Generate browser version compatibility badges.

example

With a json file like this:

{
  "explorer" : { "7.0" : false, "8.0" : false, "9.0" : false },
  "firefox" : { "10.0" : true, "11.0" : true, "12.0" : false, "13.0" : true, "nightly" : true },
  "chrome" : { "14.0" : true, "15.0" : true, "16.0" : true, "canary" : true },
  "safari" : { "5.0.5" : false, "5.1.0" : false, "5.1.1" : true },
  "opera" : { "10.6" : false, "11.0" : "pending", "11.6" : "pending" }
}
$ browser-badge browsers.json -o badge.png

badge

usage

browser-badge {infile | -i infile | -} {outfile | -o outfile | -}

  infile should be a json object mapping browser names to version
  compatabilities

  outfile will be a png file with the browser badge data

methods

var browserBadge = require('browser-badge')

browserBadge(browsers)

Return a readable stream of png data from the browser version compatability object browsers.

browsers should map browser names to maps of versions to booleans expressing compatbility or "pending" to indicate that the browser tests have not yet finished.

install

To get the command-line tool, with npm do:

npm install -g browser-badge

to install the library do:

npm install browser-badge
Something went wrong with that request. Please try again.