Skip to content

LavoroEasy Background Task Scheduling for Node.js

Fluent, type-safe API & support for multiple drivers

Lavoro is a background job queue and scheduler for Node.js

Ever wanted to ...

  1. Just specify the job with a type-safe payload:
ts
import { Job } from '@lavoro/core'

export class Inspire extends Job {
  async handle(payload: { quote: string }): Promise<void> {
    logger.info(payload.quote)
  }
}
  1. Start background job processing:
ts
const queue = new Queue(queueConfig)
Job.setDefaultQueueServiceResolver(() => queue)

await queue.start()
  1. And simply use it:
ts
await Schedule.job(Inspire, {
  quote: 'Done is better than perfect',
}).every('five seconds')

... without running a separate worker process and manually coordinating job scheduling?

Lavoro makes this a breeze.

First, install the queue drivers:

bash
npm install @lavoro/postgres

Then, follow a comprehensive guide to get started.

Or if you're curious about the design philosophy behind Lavoro and how it is different, check out the motivation section of the introduction.

Released under the MIT License.