Installation
Requirements
Bun Required
StrataDB only works with Bun. It uses bun:sqlite which is not available in Node.js or Deno.
ESM Only
StrataDB is an ESM-only package. It does not provide CommonJS exports.
- Bun v1.0 or later
Install StrataDB
bash
bun add stratadbOptional: Validation Libraries
StrataDB works with any Standard Schema compatible validation library:
bash
# Choose one (or none)
bun add zod # Most popular
bun add arktype # Best TypeScript integration
bun add valibot # Lightweight alternativeSee Validation for usage examples.
TypeScript Configuration
StrataDB is written in TypeScript and includes type definitions. For best results, enable strict mode in your tsconfig.json:
json
{
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext"
}
}Verify Installation
typescript
import { Strata } from 'stratadb'
const db = new Strata({ database: ':memory:' })
console.log('StrataDB is working!')
db.close()Run with:
bash
bun run your-file.ts