ipc-express for electron
This library enables you to use the express framework in the mainthread of electron but without the http overhead.
Usage
Installation
npm i ipc-express
in your main.js file
const ipcMain = ;const express = ;const IpcServer = ; const expressApp = ;const ipc = ipcMain; const someMiddleware = { ;};expressApp; expressApp; ipc;
In your frontend framework
;const ipcRenderer = window; const ipc = ipcRenderer; async { const testId = 5; const data = await ipc; const params query = data; console }
example
An example can be found in the example-app
folder.
To start the example-app:
cd example-appnpm run start:mainnpm run start:renderer
contribute
- fork this repo
npm i
- make changes on new branch
- update README
- submit PR
Todo
- extend the response object to an more express-like one
License
Copyright © 2019-Present, René Heinen. All rights reserved.