electron-badge

Electron badge works well for Windows

Usage no npm install needed!

<script type="module">
  import electronBadge from 'https://cdn.skypack.dev/electron-badge';
</script>

README

electron-badge

NPM version NPM monthly download

Electron badge works well for Windows

Installation

$ yarn add electron-badge

Usage

// main.js

const Badge = require('electron-badge');

function createWindow() {
  win = new BrowserWindow({width: 800, height: 600});
  const badgeOptions = {};
  new Badge(win, badgeOptions);
}
// index.html
ipcRenderer.send('update-badge', 5, {background: 'crimson'});

// To remove badge
ipcRenderer.send('update-badge', 0); // or null

API

Badge options(Windows only)

Option Name Default Value
color white
backaground red
fontSize 12px
fontFamily Arial
fontWeight bold
max 99

License

MIT © Nghiep