@quantic-impact/rvf-node 0.2.0
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.js +47 -0
- package/package.json +17 -0
- package/rvf-node.darwin-arm64.node +0 -0
package/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* N-API loader for @quantic-impact/rvf-node */
|
|
2
|
+
const { existsSync } = require('fs');
|
|
3
|
+
const { join } = require('path');
|
|
4
|
+
|
|
5
|
+
const { platform, arch } = process;
|
|
6
|
+
|
|
7
|
+
let nativeBinding = null;
|
|
8
|
+
let loadError = null;
|
|
9
|
+
|
|
10
|
+
const platformArchMap = {
|
|
11
|
+
'darwin-arm64': 'rvf-node.darwin-arm64.node',
|
|
12
|
+
'darwin-x64': 'rvf-node.darwin-x64.node',
|
|
13
|
+
'linux-x64': 'rvf-node.linux-x64-gnu.node',
|
|
14
|
+
'linux-arm64': 'rvf-node.linux-arm64-gnu.node',
|
|
15
|
+
'win32-x64': 'rvf-node.win32-x64-msvc.node',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const binaryName = platformArchMap[`${platform}-${arch}`];
|
|
19
|
+
|
|
20
|
+
if (!binaryName) {
|
|
21
|
+
loadError = new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
22
|
+
} else {
|
|
23
|
+
const localPath = join(__dirname, binaryName);
|
|
24
|
+
if (existsSync(localPath)) {
|
|
25
|
+
try {
|
|
26
|
+
nativeBinding = require(localPath);
|
|
27
|
+
} catch (e) {
|
|
28
|
+
loadError = e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Fallback: try the @ruvector/rvf-node package (upstream compatible)
|
|
33
|
+
if (!nativeBinding) {
|
|
34
|
+
try {
|
|
35
|
+
nativeBinding = require('@ruvector/rvf-node');
|
|
36
|
+
} catch (e) {
|
|
37
|
+
if (!loadError) loadError = e;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!nativeBinding) {
|
|
43
|
+
if (loadError) throw loadError;
|
|
44
|
+
throw new Error('Failed to load @quantic-impact/rvf-node native binding');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = nativeBinding;
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quantic-impact/rvf-node",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "RuVector Format Node.js native bindings with META_SEG, COW branching, membership, and witness chain",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"files": ["index.js", "*.node"],
|
|
8
|
+
"os": ["darwin", "linux", "win32"],
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">= 18"
|
|
11
|
+
},
|
|
12
|
+
"keywords": ["ruvector", "rvf", "vector-database", "hnsw", "native", "napi", "rust"],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
Binary file
|