0
I want to run a JS file along with Electron and return its result within the rendering part of Electron
Code I want to show inside the Electron in the HTML part:
const si = require('systeminformation');
si.cpu().then(data => console.log(data));
As I think it may be:
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Cria uma janela de navegação.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// e carregar o index.html do aplicativo.
win.loadFile('index.html')
}
function informationSystem(){
const si = require('systeminformation');
si.cpu().then(data => console.log(data));
}
informationSystem()
app.whenReady().then(createWindow)