All the Electron Docs!

创建 BrowserWindow

从 main process 中创建

const { BrowserWindow } = require('electron')

const win = new BrowserWindow()

从 renderer process 中创建(由于 renderer process 不允许进行 GUI 相关 API,所有需要与 master process 通讯)

const { remote } = require('electron')
const { BrowserWindow } = remote

const win = new BrowserWindow()

Sqlite3

npm install sqlite3 --save

npm install electron-rebuild --save
./node_modules/.bin/electron-rebuild
yarn add sqlite3

# yarn add -D electron-rebuild
# yarn electron-rebuild

Realm

npm install realm