Fast handcraft svg badge generator library . Used on badgen.net.
 
 
Go to file
Amio 3dc25dd7be 1.2.0 2018-07-15 17:37:15 +08:00
bench Add options: {style: 'flat'} 2018-07-15 17:22:56 +08:00
lib Lighter shadow for flat style 2018-07-15 17:30:36 +08:00
preview Add options: {style: 'flat'} 2018-07-15 17:22:56 +08:00
test Add tests for option {style: 'flat'} 2018-07-15 17:25:25 +08:00
.gitignore Initial commit 2018-05-29 16:53:54 +08:00
.npmignore Organize folders 2018-07-15 16:19:44 +08:00
.travis.yml Add .travis.yml 2018-06-23 20:13:47 +08:00
README.md Add options: {style: 'flat'} 2018-07-15 17:22:56 +08:00
package-lock.json 1.2.0 2018-07-15 17:37:15 +08:00
package.json 1.2.0 2018-07-15 17:37:15 +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 options = { style: 'flat' }

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

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:

[classic] style, long params  x 1,071,083 ops/sec ±0.82% (89 runs sampled)
[classic] style, full params  x 1,332,181 ops/sec ±0.80% (92 runs sampled)
   [flat] style, long params  x 1,145,825 ops/sec ±0.73% (94 runs sampled)
   [flat] style, full params  x 1,416,453 ops/sec ±0.69% (91 runs sampled)

License

ISC