Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-badge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-badge

Component Badge Generator

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

component badge Build Status

Based on @timoxley's idea and made for @ForbesLindesay's website

npm install component-badge


badge([count, [options]]) returns a String representing a SVG image.
count is the number shown under the logo ("1337 available"). If left out the subline comletely vanishes.
options is an object that takes these params including their default values.

  • scale: 1
  • subtitlePos: "bottom"
  • subtitleFill: "#939393"
  • backgroundFill: "none"
  • titleFill: "#000000"
  • circleFill: "#353535"
  • leftAnnulusFill: "#353535"
  • rightAnnulusFill: "#939393"

badge.load(path) loads a new template.
path is the path to the template to be loaded.

var badge = require("component-badge");

console.log(badge(1337, 1.5)); // <svg width="720px" height="180px">...

badge.load("./myNewLogo.svg");

Fun Fact: The vector graphic was generated by JavaScript.

Keywords

FAQs

Package last updated on 25 Dec 2012

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