Skip to main content

Driver Installation

The official driver is distributed via npm under the package name @liorans3/driver.


Package Details​

  • Package Name: @liorans3/driver
  • Current Version: 0.1.0-prealpha.1
  • Module Support: Pure ESM ("type": "module") with TypeScript .d.ts type definitions.
  • Dependencies: Uses undici for high-throughput HTTP/1.1 connection pooling.

Installation Commands​

npm​

npm install @liorans3/driver

pnpm​

pnpm add @liorans3/driver

yarn​

yarn add @liorans3/driver

Bun​

bun add @liorans3/driver

TypeScript Setup​

Ensure your tsconfig.json specifies modern module resolution (NodeNext or Bundler):

tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}

Importing the Driver​

TypeScript / ES Modules​

import {
BastionClient,
BucketHandle,
BastionObject,
BastionError,
NotFoundError,
} from "@liorans3/driver";

Dynamic Import (CommonJS)​

If your project uses CommonJS ("type": "commonjs"), import dynamically:

async function loadClient() {
const { BastionClient } = await import("@liorans3/driver");
const client = new BastionClient("bastion://admin:pass@127.0.0.1:27118");
return client;
}