kopia lustrzana https://github.com/badgen/badgen
2.2 KiB
2.2 KiB
badgen
Fast, handcraft, pure JavaScript badge generator.
- 🌀 No dependeny.
- ⚡️ 200K+ ops on average. (see benchamrks)
Usage
Badge Service
https://badgen.now.sh/badge/:subject/:status/:color
subject
Textstatus
Textcolor
Color RGB (default '3C1') or Color Preset (green
,yellow
, ...see below)
Color Presets:
Examples:
Programmatically
npm install badgen
const badgen = require('badgen')
const svgString = badgen({
subject: 'npm',
status: 'v1.2.3',
color: 'blue'
})
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