Elffuss BraidHub

kikocis/lancedb public

main · 1.3 KiBRenderedRawPermalink
1vectordb / [Exports](modules.md)
2
3# LanceDB
4
5A JavaScript / Node.js library for [LanceDB](https://github.com/lancedb/lancedb).
6
7## Installation
8
9```bash
10npm install vectordb
11```
12
13This will download the appropriate native library for your platform. We currently
14support:
15
16* Linux (x86_64 and aarch64)
17* MacOS (Intel and ARM/M1/M2)
18* Windows (x86_64 only)
19
20We do not yet support musl-based Linux (such as Alpine Linux) or aarch64 Windows.
21
22## Usage
23
24### Basic Example
25
26```javascript
27const lancedb = require('vectordb');
28const db = await lancedb.connect('data/sample-lancedb');
29const table = await db.createTable("my_table",
30 [{ id: 1, vector: [0.1, 1.0], item: "foo", price: 10.0 },
31 { id: 2, vector: [3.9, 0.5], item: "bar", price: 20.0 }])
32const results = await table.search([0.1, 0.3]).limit(20).execute();
33console.log(results);
34```
35
36The [examples](./examples) folder contains complete examples.
37
38## Development
39
40To build everything fresh:
41
42```bash
43npm install
44npm run build
45```
46
47Then you should be able to run the tests with:
48
49```bash
50npm test
51```
52
53### Fix lints
54
55To run the linter and have it automatically fix all errors
56
57```bash
58npm run lint -- --fix
59```
60
61To build documentation
62
63```bash
64npx typedoc --plugin typedoc-plugin-markdown --out ../docs/src/javascript src/index.ts
65```