Elffuss BraidHub

kikocis/lancedb public

d4aef929e8cc · 1.4 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 tsc
45npm run build
46```
47
48Then you should be able to run the tests with:
49
50```bash
51npm test
52```
53
54### Rebuilding Rust library
55
56```bash
57npm run build
58```
59
60### Rebuilding Typescript
61
62```bash
63npm run tsc
64```
65
66### Fix lints
67
68To run the linter and have it automatically fix all errors
69
70```bash
71npm run lint -- --fix
72```
73
74To build documentation
75
76```bash
77npx typedoc --plugin typedoc-plugin-markdown --out ../docs/src/javascript src/index.ts
78```