dsch-electron-edge-js
Version:
Edge.js: run .NET and Node.js in-process on Electron
16 lines (11 loc) • 433 B
JavaScript
// Overview of edge.js: http://tjanczuk.github.com/edge
var edge = require('../lib/edge');
var hello = edge.func('async (input) => { return ".NET welcomes " + input.ToString(); }');
// call the function synchronously
var result = hello('Node.js', true);
console.log(result);
// call the same function asynchronously
hello('JavaScript', function (error, result) {
if (error) throw error;
console.log(result);
});