-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtoaster.js
More file actions
28 lines (24 loc) · 640 Bytes
/
toaster.js
File metadata and controls
28 lines (24 loc) · 640 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* eslint-disable no-console */
const path = require( 'path' );
const toasted = require( '../index' );
toasted.notify(
{
message: 'This is a longer notification which\ndisplays numerous lines of text for\nthe user to see.\nNice.',
icon: path.join( __dirname, 'example_1.png' ),
sound: true
},
( err, data ) =>
{
// Will also wait until notification is closed.
console.log( 'Waited' );
console.log( JSON.stringify({ err, data }) );
}
);
toasted.on( 'timeout', () =>
{
console.log( 'Timed out!' );
});
toasted.on( 'click', () =>
{
console.log( 'Clicked!' );
});