electron

Saving JSON in Electron

ⅰ亾dé卋堺 提交于 2020-06-11 21:26:11
问题 I am building an app using Electron. In this app, I am building a data structure using JSON. My data structure looks like this: { items: [ { id:1, name:'football' }, { id:2, name:'soccer ball' }, { id:3, name:'basketball' } ] } I want to save this JSON to a file called "data.json". I want to save it to a file because I want to load the next time the application starts. My challenge is, I do not know how to save the data. In fact, I'm not sure where I should even save the file. Do I save it in

How to distribute a built executable constructed using electron-builder

感情迁移 提交于 2020-06-01 07:42:06
问题 I have recently packaged an electron app using electron-builder: myProject/ ├── package.json ├── app/ └── release/ All files created by electron-builder are place in the release directory. The executable works fine on my local machine, with all features present through the packaged app. However, once I move the application to another machine only some features are available. Noticeably features within subdirectories in app/ are not included. For example here a snippet of the app/ directory:

Load local JSON into electron, can't use require/include

北慕城南 提交于 2020-05-30 07:42:25
问题 I've been refactoring this code into public and I'm using this to solve some past mistakes. Like writing my save and load functions. I need to load in my code some JSON files. Doesn't matter where if I can access it here https://github.com/cicerohellmann/3DBRPG/blob/board/board/boardView.js I've run into most of the possible solutions when trying to bring a file inside of electron or work arounds for not being able to use require or include in my js files after opening my project with

How to run packaged electron app on linux?

人盡茶涼 提交于 2020-05-30 06:47:23
问题 I haven't used Linux much but I'm trying to run an application which I've packaged using electron-packager. So while on Linux, I can run npm start and my app works fine. But when I package it, there doesn't seem to be an installer or anything. Packaging and running on Windows work fine. I packaged using: npm run package-linux Edit as requested: I'm using Linux mint-19.1-cinnamon-64bit. The package script I used is; "package-linux": "electron-packager . electron-tutorial-app --overwrite --asar

How to run packaged electron app on linux?

[亡魂溺海] 提交于 2020-05-30 06:46:25
问题 I haven't used Linux much but I'm trying to run an application which I've packaged using electron-packager. So while on Linux, I can run npm start and my app works fine. But when I package it, there doesn't seem to be an installer or anything. Packaging and running on Windows work fine. I packaged using: npm run package-linux Edit as requested: I'm using Linux mint-19.1-cinnamon-64bit. The package script I used is; "package-linux": "electron-packager . electron-tutorial-app --overwrite --asar

Can I use npm library without npm installed?

我怕爱的太早我们不能终老 提交于 2020-05-29 07:03:08
问题 I am developing a NodeJS application. It will be deployed with Electron. This is good because all I will need to do is to package my application in an app folder inside the Electron package, then rebrand it as described on the official Electron documentation, and I will be ready to install it on any computer. In particular, deploying with Electron means that I don't need to have NodeJS installed on my user's computer, because the Electron package is itself a NodeJS interpreter so it is going