Notification API, so if you’ve previously used the Web Notifications API, the same patterns work here without requiring a browser or service worker.
Creating your first notification
The simplest notification only needs a title.show() method. The notification is displayed immediately when constructed.
Displaying an icon
You can provide either a platform icon name or a path to an image.Displaying an image
Notifications can include a larger preview image.Buffer is useful when the image was downloaded or generated entirely in memory.
Responding to notification events
Notifications areEventEmitters.
Action buttons
Long-running applications often provide quick actions directly inside notifications.persistent: true. Attempting to use actions without persistence throws a TypeError.
Persistent notifications
By default, notifications are fire-and-forget. If the rest of your application exits immediately afterwards, the notification will no longer receive interaction events. Enable persistence when the user needs to interact with the notification.Closing a notification
On supported platforms you can close a notification yourself.Permissions
Unlike browsers, desktop applications do not ask for notification permission."granted" for browser compatibility.