electron-start
is an electron boilerplate based on github electron-api-demos
folder architecture.
In your directory you can run
$ curl -fsSL https://github.com/frinyvonnick/electron-start/archive/master.tar.gz | tar -xz --strip-components 2
You can also git clone
or download this repository.
The folder architecture is based on electron-api-demos
app from github. Here is a markdown document that explains in details this architecture.
All files in the folder src/main-process/listeners are automatically required in the application.
module-alias
lets you define alias for paths in your package.json.
A few are already defined:
alias | path |
---|---|
src | src |
assets | src/assets |
windows | src/windows |
main-process | src/main-process |
renderer-process | src/renderer-process |
nodemon
watch files in src/main-process with the extension .js and reload your application if any change occurs.
The file src/main-process/windows.js exports a method createWindow
that facilitate create new windows.
It takes an object of options as parameter:
property | type | isRequired | options |
---|---|---|---|
file | string | yes | The path to a HTML file to inject in the new window |
data | object | no | This is an optional object that is injected in the renderer process as a global variable called __args__ |
options | object | no | This is regular options for BrowserWindow's constructor |
MIT © FRIN Yvonnick