Node.jsでnode側と描画処理側とのやりとりメモ

正直、行き当たりばったりで動かしているので、
対応があっているのか不明だけど、Nodeの書き方を一旦メモ

 

Node側から描画処理側の処理を呼ぶ場合

Node側
BrowserWindow.getFocusedWindow()、focusedWindow.webContents.send(チャンネル名, データ)
描画側
ipcRenderer.on(チャンネル名, (event, データ))
 

描画処理側からのNodeの処理を呼ぶ場合

Node側
ipcMain.on(チャンネル名,(event, データ))

描画側
ipcRenderer.send(チャンネル名, データ)