Prerequisites #
Before installing Vorsteh Queue, ensure you have:
- Node.js 20+
- PostgreSQL 12+ database
-
ESM project
- Add
"type": "module"
to yourpackage.json
or use.mjs
file extensions
Quick Start with CLI (Recommended) #
The fastest way to get started is using the create-vorsteh-queue
CLI tool:
# Interactive setup
npx create-vorsteh-queue my-queue-app
# Or with specific options
npx create-vorsteh-queue worker-service \
--template=drizzle-postgres \
--package-manager=pnpm \
--quiet
Available Templates #
- drizzle-pg - Basic Drizzle ORM with node-postgres
- drizzle-pglite - Zero-setup with embedded PostgreSQL
- drizzle-postgres - Advanced with recurring jobs
- event-system - Comprehensive event monitoring
- progress-tracking - Real-time progress updates
- pm2-workers - Multi-process workers with PM2
Manual Installation #
If you prefer to add Vorsteh Queue to an existing project:
Drizzle ORM (PostgreSQL) #
npm install @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
pnpm add @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
bun add @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
yarn add @vorsteh-queue/core @vorsteh-queue/adapter-drizzle
Prisma ORM (PostgreSQL) #
npm install @vorsteh-queue/core @vorsteh-queue/adapter-prisma
pnpm add @vorsteh-queue/core @vorsteh-queue/adapter-prisma
bun add @vorsteh-queue/core @vorsteh-queue/adapter-prisma
yarn add @vorsteh-queue/core @vorsteh-queue/adapter-prisma
Kysely (PostgreSQL) #
npm install @vorsteh-queue/core @vorsteh-queue/adapter-kysely
pnpm add @vorsteh-queue/core @vorsteh-queue/adapter-kysely
bun add @vorsteh-queue/core @vorsteh-queue/adapter-kysely
yarn add @vorsteh-queue/core @vorsteh-queue/adapter-kysely
Database Setup #
After installation, you'll need to set up the required database tables. Each adapter provides migration scripts or schema definitions:
- Drizzle : Use the provided schema and run migrations
-
Prisma
: Add the schema to your
schema.prisma
and runprisma migrate
- Kysely : Use the provided schema and run migrations
Refer to the specific adapter documentation for detailed setup instructions.
Verify Installation #
Create a simple test file to verify your installation:
import { Queue } from "@vorsteh-queue/core"
// Your adapter import will vary based on your choice
console.log("Vorsteh Queue installed successfully!")
Run the file with Node.js to confirm everything is working correctly.