diff --git a/npm/sqlite-vec/index.js b/npm/sqlite-vec/index.js new file mode 100644 index 00000000..2b7b9ddf --- /dev/null +++ b/npm/sqlite-vec/index.js @@ -0,0 +1,47 @@ +const os = require('os'); + +const platform = os.platform(); + +const arch = os.arch(); + +let binary; + +if (platform === 'linux' && arch === 'x64') { + + binary = require('sqlite-vec-linux-x64'); + +} else if (platform === 'linux' && arch === 'arm64') { + + binary = require('sqlite-vec-linux-arm64'); + +} else if (platform === 'darwin' && arch === 'x64') { + + binary = require('sqlite-vec-macos-x64'); + +} else if (platform === 'darwin' && arch === 'arm64') { + + binary = require('sqlite-vec-macos-arm64'); + +} else if (platform === 'win32' && arch === 'x64') { + + binary = require('sqlite-vec-windows-x64'); + +} else if (platform === 'android' && arch === 'arm64') { + + binary = require('sqlite-vec-android-arm64'); + +} else { + + throw new Error(`Unsupported platform: ${platform} ${arch}. Please install the appropriate sqlite-vec binary package.`); + +} + +module.exports = { + + load: function(db) { + + db.loadExtension(binary); + + } + +}; \ No newline at end of file diff --git a/npm/sqlite-vec/package.json b/npm/sqlite-vec/package.json new file mode 100644 index 00000000..dae0dd42 --- /dev/null +++ b/npm/sqlite-vec/package.json @@ -0,0 +1,71 @@ +{ + + "name": "sqlite-vec", + + "version": "0.1.6", + + "description": "A vector search SQLite extension that runs anywhere!", + + "main": "index.js", + + "scripts": { + + "test": "echo \"Error: no test specified\" && exit 1" + + }, + + "optionalDependencies": { + + "sqlite-vec-linux-x64": "*", + + "sqlite-vec-linux-arm64": "*", + + "sqlite-vec-macos-x64": "*", + + "sqlite-vec-macos-arm64": "*", + + "sqlite-vec-windows-x64": "*", + + "sqlite-vec-android-arm64": "*" + + }, + + "keywords": [ + + "sqlite", + + "vector", + + "search", + + "extension", + + "ai", + + "ml", + + "embeddings" + + ], + + "author": "Alex Garcia", + + "license": "MIT OR Apache-2.0", + + "repository": { + + "type": "git", + + "url": "git+https://github.com/asg017/sqlite-vec.git" + + }, + + "bugs": { + + "url": "https://github.com/asg017/sqlite-vec/issues" + + }, + + "homepage": "https://github.com/asg017/sqlite-vec#readme" + +} \ No newline at end of file