constructor

The constructor begins opening a Client immediately, and returns before the Client is ready.

new Client(options?: ClientOptions): Client
TypeDescription
options?ClientOptions
returnsClient

Prefer the create function, which constructs a Client and resolves once it is ready, unless code specifically needs the waitReady lifecycle.

Example

import {Client} from 'tinyjoin';

const db = new Client({dataDir: 'opfs://my-app-v1'});
console.log(db.ready);
// -> false

await db.waitReady;
console.log(db.ready);
// -> true
await db.close();