jarradseers/express-load — pull request #14 by egorse (2013-12-15 20:31:36+00:00)
Title: Added optional callback to see where load is done

At current implementation it is not possible to got called when actual load is really done. The ```.into(app)``` returns control prior to complete loading. That could be crucial when some of modules suppose to complete initialization before application started (```app.listen(...)```) .

This simple patch adds optional second parameter to ```into``` to point the normal callback function.

Example:
```
load('collections')
.into(app, function(err, instance) {
if(err) throw err; // the @err actually is always null
app.listen(app.get('port'));
});
```