webContents.send and ipcRenderer.on Not Working
问题 I'm pretty new to NodeJS, but I do have quite a bit of experience with vanilla JS. In the following code, what exactly am I doing wrong here? It doesn't console.log anything in the app's developer console, so I'm assuming the channel of communication is broken somehow? Does it have anything to do with the fact that readdir is asynchronous? index.js fs.readdir(__dirname, (err, files)=>{ files.forEach((file, index)=>{ console.log('display', __dirname+'\\'+file) // this prints everything as