A Electron app template with Svelte framework.
degit
npx degit github:lawondyss/svelte-electron-template <folder-name>
or
git
git clone https://github.com/Lawondyss/svelte-electron-template.git <folder-name>
cd <folder-name>
npm
npm install
npm run dev
or
yarn
yarn install
yarn run dev
backend/
- api.js -> create comunication between backend and frontend
- handlers.js -> backend handlers for calling channels from frontend
- index.js -> Electron initialization
- preload.js -> calling before starting frontend
frontend/
- app.js -> Svelte initialization
- App.svelte -> Svelte main component
public/
- global.css -> global CSS styles
- index.html -> main HTML file of application
This methods run on backend (NodeJS) of application and returns results for frontend. Methods are calling from exposed function window.api()
in frontend.
First parameter of window.api()
is name of handler. All others parameters are passed to handler.
Calling a window.api()
returns a promise and value for then()
is result of handler.