Sign in Join
Wiki copytemporary

pas2js Electron Web Application

Electron Web Application

Since Lazarus 2.3 and pas2js 2.2.1.

Install Electron

First you must install node.js.

sudo apt install nodejs npm

Check that node and npm work:

node -v
npm -v

Create some directory and install electron there:

mkdir mynodejs
cd mynodejs
npm install --save-dev electron

This should create a sub folder node_modules containing electron:

C:\Whatever\mynodejs\node_modules\electron\dist\electron.exe

Set the full path to this executable in Lazarus Tools / Options / pas2js / Electron executable

Lazarus Electron Web Application

Install pas2jsdgn package. For more information see here.

You 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.

After 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.

To 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.


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.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.