Fast handcraft svg badge generator library . Used on badgen.net.
 
 
Go to file
Amio a95392e8e0 1.1.3 2018-07-11 13:41:40 +08:00
bench Use integer for calculation -> performance++ 2018-07-01 16:10:00 +08:00
lib Limit widthTable precision to 2 2018-07-11 13:38:30 +08:00
test Update preview 2018-07-11 13:40:30 +08:00
.gitignore Initial commit 2018-05-29 16:53:54 +08:00
.npmignore Update .npmignore 2018-07-01 16:28:08 +08:00
.travis.yml Add .travis.yml 2018-06-23 20:13:47 +08:00
README.md Remove textLength attr. performance boost 2018-07-11 01:28:59 +08:00
package-lock.json 1.1.3 2018-07-11 13:41:40 +08:00
package.json 1.1.3 2018-07-11 13:41:40 +08:00

README.md

badgen npm-version install size

Fast, handcraft, pure JavaScript badge generator.

Usage

npm package

npm install badgen

const badgen = require('badgen')

const svgString = badgen({
  subject: 'npm',   // <Text>
  status: 'v1.2.3', // <Text>
  color: 'blue'     // <Color RGB> or <Color Name>
})

Available color names:

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 1,085,052 ops/sec ±1.03% (83 runs sampled)
generate by long params  x 1,046,942 ops/sec ±0.61% (93 runs sampled)
generate by full params  x 1,266,881 ops/sec ±0.76% (91 runs sampled)

License

ISC