Skip to content

Instantly share code, notes, and snippets.

@thatisuday
Created December 29, 2020 20:44
Show Gist options
  • Save thatisuday/5c3f4b71213362891acca889d7de5f7e to your computer and use it in GitHub Desktop.
Save thatisuday/5c3f4b71213362891acca889d7de5f7e to your computer and use it in GitHub Desktop.
A sample JavaScript file to display notifications in an Electron app.
const { Notification } = require( 'electron' );
// display files added notification
exports.filesAdded = ( size ) => {
const notif = new Notification( {
title: 'Files added',
body: `${ size } file(s) has been successfully added.`
} );
notif.show();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment