Fast handcraft svg badge generator library . Used on badgen.net.
 
 
Go to file
Amio ed1f597fb1 0.2.1 2018-06-26 15:02:08 +08:00
bench Simplify benchmarks 2018-06-23 17:59:12 +08:00
lib Fix width calc with unicode 2018-06-23 19:39:25 +08:00
test Add lint & test 2018-06-23 00:35:29 +08:00
.gitignore Initial commit 2018-05-29 16:53:54 +08:00
.npmignore Add .npmignore 2018-06-23 00:37:11 +08:00
README.md Move badge service to standalone repo 2018-06-26 14:57:57 +08:00
package-lock.json 0.2.1 2018-06-26 15:02:08 +08:00
package.json 0.2.1 2018-06-26 15:02:08 +08:00

README.md

badgen npm-version install size

Fast, handcraft, pure JavaScript badge generator.

  • 🌀 No dependeny.
  • 200K+ ops on average. (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 @ Amio