Installation
Requirements
- Node.js 24 (
engines.nodein the package), or a runtime with the Web Platform APIs: Bun, Deno, Cloudflare Workers withnodejs_compat - npm; the package ships ESM only, there is no CJS build
- TypeScript 5 or later
Install the package
bash
npm install @loewen-digital/fullstackThe package has no dependencies of its own: the modules talk HTTP through fetch or take a client you hand them.
Optional packages
Install only what the driver you use needs:
bash
# auth on flatdb collections (see the Auth on flatdb guide)
npm install @loewen-digital/flatdb zod
# db module (Drizzle on SQLite, for apps on a SQL database) and the sqlite-fts search driver
npm install drizzle-orm better-sqlite3
npm install -D @types/better-sqlite3
# SMTP mail driver
npm install nodemailer
# Redis drivers for cache, session and queue: any client with the ioredis / node-redis v4 methods
npm install ioredis
# Types for Cloudflare bindings (KV, R2, Queues)
npm install -D @cloudflare/workers-typesResend, Postmark, S3, R2, Meilisearch and Typesense are reached through fetch; no SDK is needed.
TypeScript setup
Every internal import carries a .js extension, so moduleResolution has to be bundler, node16 or nodenext. SvelteKit, Vite and the other meta-frameworks set this already.
json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true
}
}Verify the installation
validate needs no setup and no I/O: rules are pipe strings, the call is async, the result is { ok: true, data } or { ok: false, errors }.
ts
import { validate } from '@loewen-digital/fullstack/validation'
async function check() {
const result = await validate({ name: 'Alice' }, { name: 'required|string' })
console.log(result.ok) // true
}If this compiles and runs, head to the Quick Start and build a login.