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

badge-icon

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badge-icon

[![npm version](https://badge.fury.io/js/badge-icon.svg)](https://badge.fury.io/js/badge-icon)

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

badge-icon

npm version

Create badge icon image

8 66 99+

Why?

I want to set badge icon to an electron based Windows app. First of all I need to create such an icon, then invoke setOverlayIcon of BrowserWindow:

// todo: create the badge icon image
mainWndow.setOverlayIcon(electron.nativeImage.createFromPath('path-to-badge-icon-image'), 'badge description')

Install

yarn add badge-icon
import BadgeIcon from 'badge-icon'

Or you include it in your web page directly:

<script src="https://unpkg.com/badge-icon@0.1.0/dist/badge-icon.js"></script>

Samples

const icon8 = new BadgeIcon({
  badgeWidth: 128, // badge width
  badgeHeight: 128, // badge height
  text: '8', // badge text
  fontSize: 96, // font size
  color: 'white', // text color
  bgColor: 'red' // background color
})

fs.writeFileSync('8.svg', icon8.svg())

8

const icon66 = new BadgeIcon({
  badgeWidth: 128, // badge width
  badgeHeight: 128, // badge height
  text: '66', // badge text
  fontSize: 64, // font size
  color: 'white', // text color
  bgColor: 'green' // background color
})

fs.writeFileSync('66.svg', icon66.svg())

66

const icon99Plus = new BadgeIcon({
  badgeWidth: 128, // badge width
  badgeHeight: 64, // badge height
  text: '99+', // badge text
  fontSize: 48, // font size
  color: 'white', // text color
  bgColor: 'blue' // background color
})

fs.writeFileSync('99+.svg', icon99Plus.svg())

99+

FAQs

Package last updated on 06 Dec 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