A ready listener, the easy way.
The ready function fires your callback if it's ready or wait until it's called with no arguments to signal it is ready.
var Ready = require("ready")
, r1 = Ready()
, r2 = Ready()
r1(function onReady() {
console.log("r1 ready")
})
setTimeout(r1, 1000)
r2()
r2(function onReady() {
console.log("r2 is already ready")
})