@rongcloud/electron-solution
v1.0.11
Published
@rongcloud/electron-solution
Downloads
31
Readme
RongCloud Electron Solution
install
npm i @rongcloud/electron-solution
example
// main.js
const { app, BrowserWindow } = require('electron')
app.on('ready', () => {
const rcService = require('@rongcloud/electron-solution')({
/**
* [option]
*/
dbpath: app.getPath('userData'),
/**
* [option] 0 - DEBUG, 1 - INFO, 2(default) - WARN, 3 - ERROR
*/
logLevel: 2,
/**
* [option]
*/
logStdout (logLevel, tag, ...args) {
console.log(tag, ...args)
}
})
const browserWin = new BrowserWindow({
webPreferences: {
preload: '<path/to/preload.js>'
}
})
// ...
app.on('before-quit', () => {
rcService.getCppProto().destroy()
})
})
// preload.js
require('@rongcloud/electron-solution/renderer')