You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have the code below and this works perfectly when I call it from Node via node index.js but once I package it using pkg and move it to /bin directory with all the files pkg says I need to ship with it stops working and there is no error output to the console and yet no notifications on windows. even though I can see via console.log code it has hit the location where it's running the code to notify again this worked perfectly via normal Node only does not work when using pkg
sendNotification=(url,picture)=>{returnnewPromise((resolve,reject)=>{notifier.notify({title: `title`,message: `Some Message`,icon: picture,// Absolute path (doesn't work on balloons)sound: true,// Only Notification Center or Windows Toasterswait: true// Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option},function(err,response,metadata){});notifier.on('click',function(notifierObject,options,event){// Triggers if `wait: true` and user clicks notificationif(event.action==="clicked"){open(url);// npm install openresolve();}});});}module.exports=(url,profilePicture)=>{constextParts=profilePicture.split('.');constext=extParts[extParts.length-1];constosLocalPath=process.env.APPDATA||(process.platform=='darwin' ? process.env.HOME+'/Library/Preferences' : process.env.HOME+"/.local/share");constfilePath=path.join(osLocalPath,'TwitchNotify/');Download.downloadFile(profilePicture,path.join(filePath,`profile_img_.${ext}`)).then((localPath)=>{sendNotification(url,localPath);});}
index.js
asyncstart(){Notify("URL to open when clicked on","URL to pic to use");}start();
The text was updated successfully, but these errors were encountered:
So I have the code below and this works perfectly when I call it from Node via
node index.js
but once I package it usingpkg
and move it to /bin directory with all the filespkg
says I need to ship with it stops working and there is no error output to the console and yet no notifications on windows. even though I can see via console.log code it has hit the location where it's running the code to notify again this worked perfectly via normal Node only does not work when usingpkg
My
bin/
file structurenotify.js
index.js
The text was updated successfully, but these errors were encountered: