impitreq 0.1.11
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/index.d.ts +3 -0
- package/index.js +23 -0
- package/package.json +26 -0
- package/prebuilds/linux-x64/impitreq.so +0 -0
- package/prebuilds/win32-x64/impitreq.dll +0 -0
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
function resolvePrebuildPath() {
|
|
4
|
+
const platform = process.platform;
|
|
5
|
+
const arch = process.arch;
|
|
6
|
+
|
|
7
|
+
if (platform === 'win32' && arch === 'x64') return path.join(__dirname, 'prebuilds', 'win32-x64', 'impitreq.dll');
|
|
8
|
+
if (platform === 'linux' && arch === 'x64') return path.join(__dirname, 'prebuilds', 'linux-x64', 'impitreq.so');
|
|
9
|
+
throw new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getLibPath() {
|
|
13
|
+
const libPath = resolvePrebuildPath();
|
|
14
|
+
if (!libPath) {
|
|
15
|
+
throw new Error('Prebuilt library path not resolved');
|
|
16
|
+
}
|
|
17
|
+
return libPath;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
getLibPath,
|
|
22
|
+
resolvePrebuildPath,
|
|
23
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "impitreq",
|
|
3
|
+
"version": "0.1.11",
|
|
4
|
+
"description": "Platform-aware distribution of the impitreq c-shared library",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"index.js",
|
|
10
|
+
"index.d.ts",
|
|
11
|
+
"prebuilds/"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/wengooooo/impit-repository"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/wengooooo/impit-repository#readme",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"impitreq",
|
|
20
|
+
"cgo",
|
|
21
|
+
"prebuilds",
|
|
22
|
+
"windows",
|
|
23
|
+
"linux"
|
|
24
|
+
],
|
|
25
|
+
"author": "wengooooo"
|
|
26
|
+
}
|
|
Binary file
|
|
Binary file
|