# node-api-dotnet

> Node-API bindings for .Net

Latest version **0.9.27** (published 2026-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-api-dotnet
pnpm add node-api-dotnet
yarn add node-api-dotnet
bun add node-api-dotnet
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.9.27 |
| Published | 2026-09-03 |
| First published | 2023-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 783 |
| Author | Microsoft |
| Maintainers | microsoft1es, microsoft-oss-releases, jasongin, rnbot, dannyvv, vmoroz |
| Keywords | Node-API, NAPI, .Net, dotnet |

## Links

- npm: https://www.npmjs.com/package/node-api-dotnet
- Repository: https://github.com/microsoft/node-api-dotnet
- Homepage: https://github.com/microsoft/node-api-dotnet#readme
- Issues: https://github.com/microsoft/node-api-dotnet/issues
- npm.io page: https://npm.io/package/node-api-dotnet

## Recent versions

- 0.9.27 (latest) — 2026-09-03
- 0.9.26 — 2026-08-19
- 0.9.25 — 2026-08-14
- 0.9.23 — 2026-08-07
- 0.9.27-ge2f5363899 — 2026-08-06
- 0.9.21 — 2026-05-27
- 0.9.29-gef9453cdcf — 2026-05-27
- 0.9.24-g9c8dd0444e — 2026-05-24
- 0.9.19 — 2026-01-16
- 0.9.18 — 2025-12-09
- 0.9.17 — 2025-10-17
- 0.9.15 — 2025-08-03
- 0.9.13 — 2025-08-02
- 0.9.12 — 2025-06-26
- 0.9.11 — 2025-03-15
- … 124 more at https://npm.io/package/node-api-dotnet/versions

## README

# 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](https://nodejs.org/api/n-api.html) so
it is compatible with any Node.js version (without recompiling) or other JavaScript runtime that
supports Node API.

:warning: _**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
// 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#
// 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](https://microsoft.github.io/node-api-dotnet/scenarios/),
either NPM or NuGet packages may be used:
 - NPM: [`node-api-dotnet`](https://www.npmjs.com/package/node-api-dotnet)
 - NuGet: [`Microsoft.JavaScript.NodeApi`](https://www.nuget.org/packages/Microsoft.JavaScript.NodeApi/)

See [Packages & Releases](https://microsoft.github.io/node-api-dotnet/reference/packages-releases.html)
for details.

## Development

For information about building, testing, and debugging this project, see
[README-DEV.md](./README-DEV.md).

Contributions require agreement to the
[Contributor License Agreement](https://microsoft.github.io/node-api-dotnet/contributing.html#contributor-license-agreement).

## Code of Conduct

This project has adopted the
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) 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](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
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.

<br/>
<br/>

![.NET + JS scene](./docs/images/dotnet-bot_scene_coffee-shop.png)

---
_Source: https://npm.io/package/node-api-dotnet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
