Socket
Socket
Sign inDemoInstall

badgen

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badgen

Fast svg badge generator.


Version published
Weekly downloads
7.4K
decreased by-14.63%
Maintainers
1
Weekly downloads
 
Created
Source

badgen

npm version install size Coverage Status

Fast handcraft svg badge generator. Used on badgen.net.

  • 🌀 1 dependency (unicode-astral-regex)
  • ⚡️ Fast by design (see benchmarks)
  • 👯‍ Pure JavaScript, running in node & browser

Usage

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>, optional
  style: 'flat',    // 'flat' or undefined, optional
  emoji: true,      // Support emoji in text, optional
  icon: 'data:image/svg+xml;base64,PHN2Zy...', // Use icon, optional
  iconWidth: 13     // Use this if icon is not square.
})

Available color names:

Benchmarks

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

[classic] style, long params x 742,904 ops/sec ±0.92% (88 runs sampled)
[classic] style, full params x 998,716 ops/sec ±0.78% (93 runs sampled)
   [flat] style, long params x 618,005 ops/sec ±0.77% (92 runs sampled)
   [flat] style, full params x 677,415 ops/sec ±0.67% (93 runs sampled)
[classic] style, with emoji  x 502,203 ops/sec ±2.11% (91 runs sampled)
[classic] style, with icon   x 844,518 ops/sec ±1.10% (94 runs sampled)

License

ISC

FAQs

Package last updated on 06 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc