Skip to content

Instantly share code, notes, and snippets.

@t57ser
Created July 28, 2022 19:19
Show Gist options
  • Save t57ser/3be2bc0d590690ece381f69e8c316edf to your computer and use it in GitHub Desktop.
Save t57ser/3be2bc0d590690ece381f69e8c316edf to your computer and use it in GitHub Desktop.
const {app, BrowserWindow, ipcMain} = require('electron')
const electron = require('electron')
const path = require('path')
const ffi = require("ffi-napi");
let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
height: 600,
webPreferences: {
nodeIntegration: true,
preload: path.join(app.getAppPath(), 'preload.js'),
contextIsolation: false,
},
})
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
if (mainWindow === null) {
createWindow()
}
})
{
"main": "main.js",
"version": "1.0.0",
"scripts": {
"start": "electron .",
"package": "electron-forge package --platform darwin --arch x64"
},
"config": {
"forge": {
"makers": [
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin",
"linux"
],
"config": {}
},
{
"name": "@electron-forge/maker-squirrel",
"config": {}
}
],
"packagerConfig": {
"prune": true,
"packageManager": false,
"asar": true,
"name": "test",
"app-copyright": "test"
},
"hooks": {},
"electronInstallerDebian": {},
"electronInstallerRedhat": {}
}
},
"dependencies": {
"ffi-napi": "4.0.3"
},
"devDependencies": {
"electron": "20.0.0-beta.11",
"electron-rebuild": "3.2.8",
"@electron-forge/cli": "6.0.0-beta.64"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment