I'm trying the following with edge.js and Visual Studio:
class Program
{
public static async void Start()
{
var data = 9;
var func = Edge.Func(File.ReadAllText("do_some_math.js"));
Console.WriteLine(await func(data));
}
static void Main(string[] args)
{
Task.Run((Action)Start).Wait();
}
}
do_some_math.js:
return function (data, callback) {
var math = require('mathjs');
// console.log("result: " + math.sqrt(data)); // works
callback(null, "result: " + math.sqrt(data));
}
I can't get a result when using callback, while mathjs works when using console.log. It seems the callback does not work after require('mathjs'). I tryed also with other modules. What's wrong here?