kebab

Half queue half pubsub. Super small (< 30 loc) and simple queue that supports subscribers.

kebab

Half queue half pubsub. Super small and simple queue that supports subscribers.

npm install kebab

var kebab = require('kebab')
  , kb = kebab();

kebab.enqueue(item)

item is what ever you want to pass when a subscriber callback is called.

Example:

kb.enqueue('hello world');

kebab.once(callback)

subscribe to a queued item. If one is currently available, callback will be invoked with it immediately.

Otherwise the callback will be invoked one time when an item is enqueued in the future.

Example:

kb.once(function (arg) { console.log('working on ', arg); });