expose wrapper and use default import

This commit is contained in:
Mikaël Francoeur 2025-07-03 10:10:39 -04:00
parent 6faa81034c
commit 50d542b719
4 changed files with 6 additions and 6 deletions

View file

@ -23,7 +23,7 @@ npm install @tursodatabase/turso
### In-Memory Database
```javascript
import { Database } from '@tursodatabase/turso';
import Database from '@tursodatabase/turso';
// Create an in-memory database
const db = new Database(':memory:');
@ -48,7 +48,7 @@ console.log(users);
### File-Based Database
```javascript
import { Database } from '@tursodatabase/turso';
import Database from '@tursodatabase/turso';
// Create or open a database file
const db = new Database('my-database.db');

View file

@ -3,7 +3,7 @@ import fs from "node:fs";
import { fileURLToPath } from "url";
import path from "node:path";
import { Database } from "../wrapper.js";
import Database from "../wrapper.js";
test("Open in-memory database", async (t) => {
const [db] = await connect(":memory:");

View file

@ -6,7 +6,7 @@
"url": "https://github.com/tursodatabase/turso"
},
"description": "The Turso database library",
"main": "index.js",
"main": "wrapper.js",
"types": "index.d.ts",
"napi": {
"name": "turso",
@ -42,4 +42,4 @@
"version": "napi version"
},
"packageManager": "yarn@4.6.0"
}
}

View file

@ -268,4 +268,4 @@ class Statement {
}
}
module.exports.Database = Database;
module.exports = Database;