npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@goddiegold/jobcore-sdk

v1.0.0

Published

SDK for JobCore job queue service

Readme

JobCore SDK

Lightweight SDK for interacting with the JobCore service.

Install

npm install jobcore-sdk

Usage

import Redis from 'ioredis';
import {
  JobContracts,
  JobCoreQueue,
  JobCoreWorker,
  JobCoreScheduler,
  ProcessorRegistry,
} from 'jobcore-sdk';

type Jobs = {
  send_email: { userId: number; template: string };
  send_notification: { userId: number; message: string };
};

const redis = new Redis('redis://127.0.0.1:6379');
const queue = new JobCoreQueue<Jobs>({ redis });

const processors = new ProcessorRegistry<Jobs>()
  .register('send_email', async (payload) => {
    // your business logic here
    payload.userId;
  });

const scheduler = new JobCoreScheduler({ redis });
await scheduler.start();

const worker = new JobCoreWorker<Jobs>({ redis, processors });
worker.start();

await queue.enqueueJob({
  type: 'send_email',
  payload: { userId: 123, template: 'welcome' },
});

Typed job contracts

Use a Jobs type to enforce payload shapes at compile time:

type Jobs = {
  send_email: { userId: number; template: string };
  send_notification: { userId: number; message: string };
};

const queue = new JobCoreQueue<Jobs>({ redis });
queue.enqueueJob({ type: 'send_email', payload: { userId: 1, template: 'welcome' } });

Worker options

const worker = new JobCoreWorker({
  redis,
  processors,
  retryStrategy: 'exponential',
  retryDelayMs: 30_000,
  retryJitterMs: 2_000,
  lockTtlMs: 30_000,
  lockRenewalIntervalMs: 15_000,
  blockTimeoutSec: 1,
  gracefulShutdownMs: 10_000,
  concurrency: 5,
});

Graceful shutdown

await worker.stop();
await scheduler.stop();
await redis.quit();

List jobs (preview)

let cursor = '0';
do {
  const page = await queue.listJobs(50, cursor);
  cursor = page.cursor;
  console.log(page.jobs);
} while (cursor !== '0');

Metrics helper

const summary = await queue.getMetrics();
console.log(summary.queues, summary.metrics);

UI dashboard

Use one of the integrations below to expose the UI and /api/summary from your server.

Express integration

import express from 'express';
import Redis from 'ioredis';
import { createExpressRouter } from 'jobcore-sdk';

const app = express();
const redis = new Redis();

app.use(createExpressRouter(express, { redis }));
app.listen(3000);

Fastify integration

import Fastify from 'fastify';
import Redis from 'ioredis';
import { registerFastifyPlugin } from 'jobcore-sdk';

const app = Fastify();
const redis = new Redis();

await registerFastifyPlugin(app, { redis });
await app.listen({ port: 3000 });

NestJS integration

import { Controller, Get } from '@nestjs/common';
import Redis from 'ioredis';
import { createNestHandlers } from 'jobcore-sdk';

const redis = new Redis();
const handlers = createNestHandlers({ redis });

@Controller()
export class DashboardController {
  @Get('/ui')
  getUi() {
    return handlers.getUi();
  }

  @Get('/api/summary')
  getSummary() {
    return handlers.getSummary();
  }
}

Processor functions (local)

import { ProcessorRegistry } from 'jobcore-sdk';

const processors = new ProcessorRegistry()
  .register('send_email', async (payload) => {
    // your business logic here
  })
  .register('send_notification', async (payload) => {
    // your business logic here
  });

await processors.process({ type: 'send_email', payload: { userId: 123 } });