node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

prom

prom, simple node.js promises

Calls functions once a promise has been delivered.

var prom = require('prom');
 
var onready = prom();
onready(console.log.bind(console, 'one'));
onready(console.log.bind(console, 'two'));
 
// Deliver the promise 
onready.deliver('delivered-arg-1', 'delivered-arg-2').
// > one delivered-arg-1 delivered-arg-2 
// > two delivered-arg-1 delivered-arg-2 
 
// Once the promise has been delivered, the callback on next event loop. 
onready(console.log.bind(console, 'three'))
// > three delivered-arg-1 delivered-arg-2 

License

MIT