Headrush
A minimal solution to defer application starts
after you have resolved your network or file dependancies.
If you have multiple dependancies like connecting to a database or other initial processing that needs to be done before the application starts, this will come in handy.
Installation
npm install headrush
Usage
You need to provide the initial dependencies you're expecting , after which the ready event will be emitted. This needs to be provided once only.
Also, you need to call the stun
function once you have finished some specific processing.
Single file example
var HeadRush = var headRush = deps: 'intialProcessing' 'redis' 'mongo' headRush { // do some processing here headRush} { // After conneting to redis headRush} { // After connecting to mongo headRush}
Multiple file Example
File 1
var HeadRush = var headRush = deps: 'intialProcessing' 'someMoreProcessing' { // do some processing here headRush }
File 2
var HeadRush = var headRush = { // do some processing here headRush }
License
MIT