New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pg-bosser

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-bosser

Type-safe wrapper around pg-boss for PostgreSQL job queues

latest
npmnpm
Version
1.1.4
Version published
Maintainers
2
Created
Source

pg-bosser

pg-bosser is a tiny wrapper over pg-boss heavily inspired by BullMQ providing end-to-end type safety for queues, workers and jobs.

Usage

npm install pg-bosser
yarn add pg-bosser
pnpm add pg-bosser

Basic example

import { Queue, Worker } from "pg-bosser";

interface IJobPayload {
  filePath: string;
}

const unzipQueue = new Queue<IJobPayload>({
  name: "unzip-queue",
  pgBossOptions: {
    connectionString: "postgres://postgres:postgres@localhost:5432/postgres",
  },
});

const worker = new Worker(unzipQueue, async (job) => {
  console.log("Processing job:", job.data.filePath);

  await new Promise((resolve) => setTimeout(resolve, 10_000));
});

const main = async () => {
  await unzipQueue.send({ filePath: "/tmp/1.zip" });

  await worker.work();
};

main();

The same queue using BullMQ:

import { Queue, Worker } from "bullmq";

interface IJobPayload {
  filePath: string;
}

// Create a new connection in every instance
const unzipQueue = new Queue<IJobPayload>("unzip-queue", {
  connection: {
    host: "redis",
    port: 6379,
  },
});

const myWorker = new Worker<IJobPayload>(
  "unzip-queue",
  async (job) => {
    console.log("Processing job:", job.data.filePath);

    await new Promise((resolve) => setTimeout(resolve, 10_000));
  },
  {
    connection: {
      host: "redis",
      port: 6379,
    },
  },
);

Development

Install dependencies

pnpm install

Keywords

pg-boss

FAQs

Package last updated on 10 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts