{"id":20834249,"url":"https://github.com/viktor-shmigol/electron-windows-badge","last_synced_at":"2025-04-09T18:17:10.934Z","repository":{"id":32837274,"uuid":"139352200","full_name":"viktor-shmigol/electron-windows-badge","owner":"viktor-shmigol","description":"Electron Windows Badge plugin to access and modify the badge number of the app icon in windows.","archived":false,"fork":false,"pushed_at":"2024-03-01T20:08:21.000Z","size":61,"stargazers_count":81,"open_issues_count":5,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T18:17:04.569Z","etag":null,"topics":["badge","electron","js","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viktor-shmigol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-01T18:31:52.000Z","updated_at":"2024-09-02T10:19:02.000Z","dependencies_parsed_at":"2024-06-18T18:37:56.172Z","dependency_job_id":null,"html_url":"https://github.com/viktor-shmigol/electron-windows-badge","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":0.4545454545454546,"last_synced_commit":"ca8d6c5d4e7e0f97585eaa2b1b8ce4f4afdbae8a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viktor-shmigol%2Felectron-windows-badge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viktor-shmigol%2Felectron-windows-badge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viktor-shmigol%2Felectron-windows-badge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viktor-shmigol%2Felectron-windows-badge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viktor-shmigol","download_url":"https://codeload.github.com/viktor-shmigol/electron-windows-badge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085321,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badge","electron","js","windows"],"created_at":"2024-11-18T00:18:40.294Z","updated_at":"2025-04-09T18:17:10.914Z","avatar_url":"https://github.com/viktor-shmigol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Electron Windows Badge\n\nElectron Windows Badge plugin to access and modify the badge number of the app icon in windows.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src='demo.gif' alt='demo'/\u003e\n\u003c/p\u003e\n\n## Installation\n  $ npm i electron-windows-badge --save\n\n## Usage\n\n    1) Require electron-windows-badge in your main process:\n        const Badge = require('electron-windows-badge');\n\n    2) Initialize new object of badge while creating window:\n        function createWindow () {\n            win = new BrowserWindow({width: 800, height: 600});\n            const badgeOptions = {}\n            new Badge(win, badgeOptions);\n        }\n\n    3) To update the badge you just need to call this(you must do it in render process):\n        ipcRenderer.sendSync('update-badge', 1);\n\n    4) To remove badge just call this(you must do it in render process):\n        ipcRenderer.sendSync('update-badge', null);\n#### Usage on Main Process\n    1) Require electron-windows-badge in your main process:\n        const Badge = require('electron-windows-badge');\n\n    2) Initialize new object of badge while creating window:\n        function createWindow () {\n            win = new BrowserWindow({width: 800, height: 600});\n            const badgeOptions = {}\n            const winBadge = new Badge(win, badgeOptions);\n            setupWinBadge(win, winBadge);\n        }\n        function setupWinBadge(win, winBadge) {\n            win.on('page-title-updated', (event, title) =\u003e {\n                // consider getCounterValue as a method that gets\n                // the number of notifications from the title, eg: (2) My App.\n                const counter = getCounterValue(title);\n                winBadge.update(counter);\n            });\n        }\n\n## API\n\n**Badge options**\n\n| Option Name          \t| Default Value \t| Description |\n| --------------------- | ------------------| ----------- |\n| `fontColor `        \t|  'white'\t\t\t| Font color |\n| `font `     \t\t\t| '24px arial'\t\t| Font style |\n| `color `          \t| 'red'       \t\t| The color of badge |\n| `fit`             \t| true     \t\t\t| Be sure that your number will be fit into badge|\n| `decimals `         \t| 0\t\t\t\t\t| Numbers after dot (For float numbers) |\n| `radius`            \t| 8       \t\t\t| The radius of badge |\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviktor-shmigol%2Felectron-windows-badge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviktor-shmigol%2Felectron-windows-badge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviktor-shmigol%2Felectron-windows-badge/lists"}