Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access appId in electron App

In Electron app, how can I access appId which I have specified in "build" section of package.json :

"build": {
    "appId": "com.myapp.Something"
}

In development I can import package.json and access it directly, however "build" section is gone from the packaged app. I want to use that id for node-notifier.

like image 808
Maciej Wozniak Avatar asked Jul 05 '18 19:07

Maciej Wozniak


1 Answers

You could use:

var fs = require("fs");
var appId = JSON.parse(fs.readFileSync("path_to_package.json", 'utf8')).build.appId;
like image 194
Andrew Feldman Avatar answered Nov 12 '22 20:11

Andrew Feldman