node-api-dotnet 0.4.17 → 0.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/init.js +8 -21
- package/linux-x64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/net472/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net472/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/net6.0/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net6.0/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/net8.0/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net8.0/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/osx-arm64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/osx-x64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/package.json +1 -1
- package/win-arm64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/win-x64/Microsoft.JavaScript.NodeApi.node +0 -0
package/init.js
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
// - ...
|
|
10
10
|
module.exports = initialize;
|
|
11
11
|
|
|
12
|
+
const ridPlatform =
|
|
13
|
+
process.platform === 'win32' ? 'win' :
|
|
14
|
+
process.platform === 'darwin' ? 'osx' :
|
|
15
|
+
process.platform;
|
|
16
|
+
const ridArch = process.arch === 'ia32' ? 'x86' : process.arch;
|
|
17
|
+
const rid = `${ridPlatform}-${ridArch}`;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Initializes the Node API .NET host.
|
|
14
21
|
* @param {string} targetFramework Minimum requested .NET version. Must be one of the target
|
|
@@ -18,29 +25,9 @@ module.exports = initialize;
|
|
|
18
25
|
*/
|
|
19
26
|
function initialize(targetFramework) {
|
|
20
27
|
const assemblyName = 'Microsoft.JavaScript.NodeApi';
|
|
21
|
-
const
|
|
22
|
-
const nativeHostPath = __dirname + `/${runtimeIdentifier}/${assemblyName}.node`;
|
|
28
|
+
const nativeHostPath = __dirname + `/${rid}/${assemblyName}.node`;
|
|
23
29
|
const managedHostPath = __dirname + `/${targetFramework}/${assemblyName}.DotNetHost.dll`
|
|
24
30
|
|
|
25
31
|
const nativeHost = require(nativeHostPath);
|
|
26
32
|
return nativeHost.initialize(targetFramework, managedHostPath, require);
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
function getRuntimeIdentifier() {
|
|
30
|
-
function getRuntimePlatformIdentifier() {
|
|
31
|
-
switch (process.platform) {
|
|
32
|
-
case 'win32': return 'win'
|
|
33
|
-
case 'darwin': return 'osx'
|
|
34
|
-
default: return process.platform;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getRuntimeArchIdentifier() {
|
|
39
|
-
switch (process.arch) {
|
|
40
|
-
case 'ia32': return 'x86'
|
|
41
|
-
default: return process.arch
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return `${getRuntimePlatformIdentifier()}-${getRuntimeArchIdentifier()}`;
|
|
46
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|