docs: add a reference to @lancedb/lance in the docs (#1166)

We aren't yet ready to switch over the examples since almost all JS
examples rely on embeddings and we haven't yet ported those over.
However, this makes it possible for those that are interested to start
using `@lancedb/lancedb`
This commit is contained in:
Weston Pace
2024-03-29 06:55:03 -05:00
parent 1b0aaf9ec3
commit e21b56293c
34 changed files with 3561 additions and 7 deletions

View File

@@ -1,12 +1,44 @@
# (New) LanceDB NodeJS SDK
# LanceDB JavaScript SDK
It will replace the NodeJS SDK when it is ready.
A JavaScript library for [LanceDB](https://github.com/lancedb/lancedb).
## Installation
```bash
npm install @lancedb/lancedb
```
This will download the appropriate native library for your platform. We currently
support:
- Linux (x86_64 and aarch64)
- MacOS (Intel and ARM/M1/M2)
- Windows (x86_64 only)
We do not yet support musl-based Linux (such as Alpine Linux) or aarch64 Windows.
## Usage
### Basic Example
```javascript
import * as lancedb from "@lancedb/lancedb";
const db = await lancedb.connect("data/sample-lancedb");
const table = await db.createTable("my_table", [
{ id: 1, vector: [0.1, 1.0], item: "foo", price: 10.0 },
{ id: 2, vector: [3.9, 0.5], item: "bar", price: 20.0 },
]);
const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray();
console.log(results);
```
The [quickstart](../basic.md) contains a more complete example.
## Development
```sh
npm run build
npm t
npm run test
```
### Running lint / format

View File

@@ -59,7 +59,7 @@
"build": "npm run build:debug && tsc -b && shx cp lancedb/native.d.ts dist/native.d.ts",
"build-release": "npm run build:release && tsc -b && shx cp lancedb/native.d.ts dist/native.d.ts",
"chkformat": "prettier . --check",
"docs": "typedoc --plugin typedoc-plugin-markdown lancedb/index.ts",
"docs": "typedoc --plugin typedoc-plugin-markdown --out ../docs/src/js lancedb/index.ts",
"lint": "eslint lancedb && eslint __test__",
"prepublishOnly": "napi prepublish -t npm",
"test": "npm run build && jest --verbose",

10
nodejs/typedoc.json Normal file
View File

@@ -0,0 +1,10 @@
{
"intentionallyNotExported": [
"lancedb/native.d.ts:Connection",
"lancedb/native.d.ts:Index",
"lancedb/native.d.ts:Query",
"lancedb/native.d.ts:VectorQuery",
"lancedb/native.d.ts:RecordBatchIterator",
"lancedb/native.d.ts:Table"
]
}