Sign in Join
Wiki copytemporary

pas2js Electron Web Application: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11# Electron Web Application
22
33Since Lazarus 2.3 and pas2js 2.2.1.
44
55# Install Electron
66
77First you must install **node.js**.
88
99- Windows, MacOS: <https://nodejs.org/en/download/>
1010- Debian, Ubuntu:
1111
12-`sudo apt install nodejs npm`
12+```text
13+sudo apt install nodejs npm
14+```
1315
1416Check that node and npm work:
1517
16-`node -v`\
17-`npm -v`
18+```text
19+node -v
20+npm -v
21+```
1822
1923Create some directory and install electron there:
2024
21-`mkdir mynodejs`\
22-`cd mynodejs`\
23-`npm install --save-dev electron`
25+```text
26+mkdir mynodejs
27+cd mynodejs
28+npm install --save-dev electron
29+```
2430
2531This should create a sub folder *node_modules* containing electron:
2632
27-`C:\Whatever\mynodejs\node_modules\electron\dist\electron.exe`
33+```text
34+C:\Whatever\mynodejs\node_modules\electron\dist\electron.exe
35+```
2836
2937Set the full path to this executable in *Lazarus Tools / Options / pas2js / Electron executable*
3038
3139# Lazarus Electron Web Application
3240
3341Install pas2jsdgn package. For more information see [[lazarus pas2js integration|here]].
3442
3543You get a new project type **Electron Web Application**, which is like a *Web Browser Application*, except this wizard creates three projects, the **preload.lpi**, the **render.lpi** and **YourApp.lpi**, and a project group.
3644
3745After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.
3846
3947To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.
4048
4149---
4250*From the Free Pascal wiki, page "pas2js Electron Web Application", as it stood on 2022-08-16 after a change by Skalogryz, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
4351Category: Applications created with Lazarus

Back to history