GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - microsoft/node-api-dotnet: Advanced interoperability between .NET and JavaScript in the same process.

BranchesTags
Open more actions menu

Latest commit

 

History

270 Commits
270 Commits

Folders and files

NameName
Last commit message
Last commit date
.ado
.ado
 
 
.github
.github
 
 
.vscode
.vscode
 
 
bench
bench
 
 
docs
docs
 
 
examples
examples
 
 
src
src
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
Directory.Build.props
Directory.Build.props
 
 
Directory.Build.targets
Directory.Build.targets
 
 
Directory.Packages.props
Directory.Packages.props
 
 
LICENSE
LICENSE
 
 
NodeApi.sln
NodeApi.sln
 
 
NuGet.config
NuGet.config
 
 
README-DEV.md
README-DEV.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
SUPPORT.md
SUPPORT.md
 
 
global.json
global.json
 
 
rid.props
rid.props
 
 
version.json
version.json
 
 

Repository files navigation

Node API for .NET: JavaScript + .NET Interop

This project enables advanced interoperability between .NET and JavaScript in the same process.

  • Load .NET assemblies and call .NET APIs in-proc from a JavaScript application.
  • Load JavaScript packages and call JS APIs in-proc from a .NET application.

Interop is high-performance and supports TypeScript type-definitions generation, async (tasks/promises), streams, and more. It uses Node API so it is compatible with any Node.js version (without recompiling) or other JavaScript runtime that supports Node API.

⚠️ Status: Public Preview - Most functionality works well, though there are some known limitations around the edges, and there may still be minor breaking API changes.

Documentation

Getting-started guidance, feature details, and API reference documentation are published at https://microsoft.github.io/node-api-dotnet

Minimal example - JS calling .NET

// JavaScript
const Console = require('node-api-dotnet').System.Console;
Console.WriteLine('Hello from .NET!'); // JS writes to the .NET console API

Minimal example - .NET calling JS

// C#
interface IConsole { void Log(string message); }

var nodejs = new NodejsPlatform(libnodePath).CreateEnvironment();
nodejs.Run(() =>
{
    var console = nodejs.Import<IConsole>("global", "console");
    console.Log("Hello from JS!"); // C# writes to the JS console API
});

Packages

Depending on the scenario, either NPM or NuGet packages may be used:

  • NPM: node-api-dotnet
  • NuGet: Microsoft.JavaScript.NodeApi

See Packages & Releases for details.

Development

For information about building, testing, and debugging this project, see README-DEV.md.

Contributions require agreement to the Contributor License Agreement.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.



.NET + JS scene

About

Advanced interoperability between .NET and JavaScript in the same process.

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

794 stars

Watchers

12 watching

Forks

80 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.