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

@rdq/redka

v1.0.1

Published

Simple and robust redis-backed queue

Downloads

17

Readme

Redka - Minimalistic queue for node.js apps

Features

  • Powered by Redis
  • Optionally log results into Mongo for easy inspection with included plugin
  • Delayed jobs
  • Job completion callbacks - client-side can optionally wait for the job to complete
  • Sequential by default, optionally parallel
  • Job context allowing fine-grained control over execution
  • Job status events on Redis pub-sub

##Usage

//server.js
const Redka = require('redka');
const server = new Redka({});
const worker = server.worker('hello');
worker.register({
  world: (params, cb) => cb(null, `Hello world, I'm ${params.username}`)
});
//client.js
const Redka = require('redka');

const client = new Redka({});
const assert = require('assert');
client.enqueue('hello', 'world', {username: 'Joe'}, (err, result) => {
  assert.equal(err, null);
  assert.equal(result, 'Hello world, I\'m Joe');
});

##API reference

Redka(configuration)

Creates new redka instance. Created instance can act as both "client" and "server". There's in fact no such separation, it's only for ease of communication. Instance is considered to be "server" if it has workers attached. It still can use all "client" methods though.

configuration - Object, required. {
  redis: { Anything acceptable for redis npm package npm package npm package
    host: 'localhost',
    port: 6570
  },
  prefix: 'redka_', Optional prefix for queue names
  runDelayedJobsManager: false, Only one instance of redka in your cluster should have this enabled. Nothing harmful if more, just suboptimal
  delayOptions: {
    pollInterval: 100, Minimal delay resolution
  }
}

.worker(queueName, options) Worker

Creates and returns new worker instance

queueName - String, required. Queue name for worker to pull jobs from
options - Object, optional. {
  parallel: 1, Number. Max number of jobs to be processed in parallel from the queue
  timeout: null, Number(seconds) Fail job taking more than X seconds to run
}

.enqueue(queueName, jobName, params, options, callback) null

Creates and puts new job into provided queue

queueName - String, required. Target queue for created job
jobName - String, required. Job name
params - Object, required. Job parameters. Must be serialisable to JSON
options - Object, optional. Job options {
  delay: null, Date or Number(seconds). When to start processing job. Requires running delayedJobManager instance
}
callback - Function, optional. Called when enqueued job is complete

.stop(callback) null

Stops all workers attached to current Redka instance. Waits for dequeued jobs to complete

callback - Function, required. Called when all workers are done processing already dequeued jobs.

.fanout(sourceQueue, configuration) null

Creates default "fanout" worker. The worker would pick up all jobs from provided source queue and push into configured targets. See examples/fanout.js for working example.

sourceQueue - String, required.
configuration - Object, required {
  job-name-to-clone-into-targets: [
    //array of destinations
    {queue: 'target-queue-one', name: 'target-job-name-one'},
    {queue: 'target-queue-one', name: 'target-job-name-two'},
    ...
  ]
}

.batch(configuration) null

Creates default batch worker. The worker would accumulate jobs from source queue into batches and create target job when either batchInterval timeout fires or batch length equals to batchSize option. See examples/batch.js for more.

configuration - Object, required {
  sourceQueue - String, required
  sourceName - String, required
  targetQueue - String, required
  targetName - String, required
  batchSize - Number, required
  batchInterval - Number, options, defaults to 1000ms
}

Worker

.register(callbacks) null

Attaches handlers to the worker and starts it if not running yet. Can be extended or overwritten when it's already running. But keep in mind - jobs with no handler will fail as soon as worker starts.

callbacks - Object, required. A map of {job-name: handlerFunction} pairs

License

MIT