Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-api-dotnet

Package Overview
Dependencies
Maintainers
5
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-api-dotnet - npm Package Compare versions

Comparing version 0.4.27 to 0.4.33

net472.d.ts

11

index.d.ts

@@ -10,2 +10,13 @@ // Copyright (c) Microsoft Corporation.

/**
* Gets the current .NET runtime version, for example "8.0.1".
*/
export const runtimeVersion: string;
/**
* Gets the framework monikier corresponding to the current .NET runtime version,
* for example "net8.0" or "net472".
*/
export const frameworkMoniker: string;
/**
* Loads a .NET assembly that was built to be a Node API module, using static binding to

@@ -12,0 +23,0 @@ * the APIs the module specifically exports to JS.

2

index.js
const initialize = require('./init');
module.exports = initialize('net6.0');
module.exports = initialize();

@@ -19,5 +19,12 @@ // Copyright (c) Microsoft Corporation.

const defaultTargetFramework = 'net8.0';
/**
* The loaded instance of the .NET Runtime. Only one instance/version may be loaded in the process.
*/
let dotnet = undefined;
/**
* Initializes the Node API .NET host.
* @param {string} targetFramework Minimum requested .NET version. Must be one of the target
* @param {string?} targetFramework Minimum requested .NET version. Must be one of the target
* framework monikers supported by the Node API .NET package. The actual loaded version of .NET

@@ -28,2 +35,12 @@ * may be higher, if the requested version is not installed.

function initialize(targetFramework) {
if (!targetFramework) {
// Some version was already loaded and no specific version was requested.
// Return the already-loaded version.
if (dotnet) {
return dotnet;
}
targetFramework = defaultTargetFramework;
}
const assemblyName = 'Microsoft.JavaScript.NodeApi';

@@ -34,3 +51,4 @@ const nativeHostPath = __dirname + `/${rid}/${assemblyName}.node`;

const nativeHost = require(nativeHostPath);
return nativeHost.initialize(targetFramework, managedHostPath, require);
dotnet = nativeHost.initialize(targetFramework, managedHostPath, require);
return dotnet;
}
{
"name": "node-api-dotnet",
"version": "0.4.27",
"version": "0.4.33",
"description": "Node-API bindings for .Net",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc