This is a fork of edge-js adapted to support Electron.
Compatible with
- Electron 10.x - Node.js v12.16.3
- Electron 10.x - Node.js v15.0.1
Usage is the same as edge or edge-js, replace require('edge')
or require('edge-js')
with require('electron-edge-js')
:
```bash
npm install electron-edge-js
```
```diff
-var edge = require('edge-js');
+var edge = require('electron-edge-js');
var helloWorld = edge.func(function () {/*
async (input) => {
return ".NET Welcomes " + input.ToString();
}
*/});
```
You must install Microsoft Visual C++ Redistributable (x86)
- .NET Core 3.1 SDK
- NodeJS >= v15.0.1
NOTE: Make sure the 3.1 SDK is the latest SDK on your machine. If you have a newer version, i.e. 5.0, you may run into build and/or runtime issues. NOTE: If you want to build for a specific version of NodeJS, you must have that version of Node installed on your computer.
Electron is built using specific version of Node.js. In order to use edge
in Electron project you would need to recompile it using the same Node.js version and Electron headers.
electron-edge-js
comes precompiled with correct Node.js versions and headers.
- Uses same codebase as
edge-js
that comes with both latest code changes fromedge
project and additional fixes and improvements available inedge-js
project. - Supports majority of Electron versions.
Simple app that shows how to work with .NET Core using compiled C# libraries. electron-edge-js-quick-start
For full documentation please see see original edge-js repo.
- Update the Readme.md file with the latest version being used. Doing a find/replace of the current version is the easist way to ensure all documentation is updated.
- Open up the
lib/edge.js
file and go to theversionMap
array which should start around line 15. Add the latest Node version to the array. - Open up the
tools/buildall.bat
file and add the latest node version to the end of the prior release listed on line 2. For example, if you added 15.0.2 it would look like this:"%~dp0\build.bat" release 12.16.3 15.0.1 15.0.2
To build the app for the latest Node version, 15.0.1 as of 2020-10-28, with Electron version 10.1.5, enter the following command in the base directory of the application:
node-gyp configure build --target=v10.1.5 --dist-url=https://electronjs.org/headers -v15.0.1
When you build the application, set the --target
argument in the command to be the Electron version you want to build for. For example, to build for Electron 11.0.0 you would change the build command to be as follows:
node-gyp configure build --target=v11.0.0 --dist-url=https://electronjs.org/headers -v15.0.1
-
Open up a terminal to the root directory of this project
-
Run the build command above from the Building section. If the build succeeds, move on to the next step.
-
Enter the following command to publish the package:
yarn publish
If you do not have yarn installed, use npm
npm publish
-
Follow the prompts to publish the package
-
Commit the package.json file if you updated the package version