Some projects with electron
- Create a folder for electron projects.
- Open command line and run npm init to create a package.json file.
- Run npm install electron --save-dev --verbose to install electron into your code. (--verbose is to check the status of installation)
- Open package.json and modify scripts to add start : "scripts": { "start": "electron .", "test": "echo "Error: no test specified" && exit 1" }
- Run npm install electron-reload to view changes on reload itself.
- You have a package.json file and node_modules installed using npm commands.
- main.js is the start point of your app. This is what opens your html page as a webpage.
- index.html and index.js are the frontend and the functionality logic files of your code respectively.
Run npm start on terminal to run the desktop app.
Go to your project's directory
- Run npm install -g electron-packager
- Run "electron-packager . " -> . indicates that you are in your current directory.