electron-to-sumjs
v1.1.1
Published
Convert Electron apps to SumJS
Readme
Electron to SumJS Converter (e2s)
A powerful, universal tool to convert Electron applications to SumJS with minimal manual effort.
Features
- Universal IPC Bridge: Automatically maps
ipcRenderer.invokecalls to your backend logic (window.processor) or native SumJS dialogues. - Dynamic Transpilation: Converts Node.js backend code to browser-compatible JS, exposing exported functions globally.
- Native Shims: Includes built-in shims for
fs,path,os, andcryptoto support common Node.js patterns in the browser. - Zero Config: Scans your project and handles the conversion automatically.
Installation
You can run it directly using npx:
npx electron-to-sumjsOr install globally:
npm install -g electron-to-sumjsUsage
- Navigate to your Electron project's root directory.
- Run the converter:
npx electron-to-sumjsor if installed globally:
e2sThe converter will:
- Create a
sumjs_distfolder (formerly neutralino_dist). - Transpile your backend code.
- Patch your HTML and Renderer JS.
- Download the SumJS binaries and client.
- Bundle everything into a ready-to-run application.
- Create a
Run your new SumJS app:
./sumjs_dist/sumjs-win_x64.exe
# or generic name depending on config
./sumjs_dist/smartapp.exeHow it Works
Universal Bridge
The converter injects a smart shim.js that intercepts Electron IPC calls.
ipcRenderer.invoke('my-function', arg)-> automatically callswindow.processor.myFunction(arg).ipcRenderer.invoke('select-folder')-> automatically opens a Native Folder Dialog.
Backend Transpilation
Your processor.js (or main backend logic) is transpiled:
module.exports,exports.foo-> converted towindow.processorassignments.fs.readFileSync-> converted toawait Neutralino.filesystem.readFile.
License
ISC
