Fast handcraft svg badge generator library . Used on badgen.net.
 
 
Go to file
Amio b7c0ad38c0 Optimize performance 2018-06-29 18:25:00 +08:00
bench
lib Optimize performance 2018-06-29 18:25:00 +08:00
test
.gitignore
.npmignore
.travis.yml
README.md
package-lock.json
package.json

README.md

badgen npm-version install size

Fast, handcraft, pure JavaScript badge generator.

  • 🌀 Zero dependeny
  • Fast (see benchamrks)

Usage

npm package

npm install badgen

const badgen = require('badgen')

const svgString = badgen({
  subject: 'npm',
  status: 'v1.2.3',
  color: 'blue'
})

Badge Service

https://badgen.now.sh/

Benchmarks

npm run bench on my iMac5K(Late 2014), 3.5G i5, with Node.js 10.5.0:

generate by short params x 420,831 ops/sec ±1.03% (87 runs sampled)
generate by long params  x 167,862 ops/sec ±1.21% (90 runs sampled)
generate by full params  x 245,303 ops/sec ±1.48% (92 runs sampled)

License

ISC