microsoft / microsoft/node-api-dotnet

Embedded njs calling back into C#

Open
#393 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
783
Forks
80
PR merge metrics
No merged PRs in 30d

Description

I am trialing this library as a replacement for a custom C#/njs embedding framework that we have in use right now. In order to work as a replacement, I need to both:

  1. Call from C# into the embedded njs environment
  2. Call from the embedded njs environment into C#

(Ideally with compile-time code generation)

I have managed to:

  1. get calls from nodejs into C# via the NPM node-api-dotnet
  2. get the embedded setup working (although the documentation is missing a few steps) calling C#->JS

But tossing nodejs.Import("node-api-dotnet") into a nodejs.Run throws exceptions.

Is bidirectional calling into/out of the embedded libnode possible? This is crucial for the project, so it will determine whether this library is viable for us.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the embedded setup and the failing nodejs.Import("node-api-dotnet") call inside nodejs.Run. Investigate whether bidirectional calls between embedded libnode and C# are supported, including the documented setup steps that are missing. Done means establishing feasibility and documenting the required approach or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, javascript, nodejs
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.