0

I am looking into solutions to call some C# code from within my NodeJS application. I came across EdgeJS, which seems to make this possible. However, I came across part of their code that is confusing to me, because I see an async keyword without an accompanying await. And while I'm more familiar with JS than C#, my understanding is that in BOTH you need to include an await with any async. This is the code in question, where some multi-line C# code is defined within backticks:

var edge = require('edge');
 
var helloWorld = edge.func(`
    async (input) => { 
        return ".NET Welcomes " + input.ToString(); 
    }
`);
 
helloWorld('JavaScript', function (error, result) {
    if (error) throw error;
    console.log(result);
});

Can someone explain how this is working, considering await doesn't appear anywhere?

Banon
  • 53
  • 6

0 Answers0