Manage application errors and plugin modules by Harald Rudell
App Runner allows to to generate and maintain many apps using shared code. Require is great, App Runner is greater!
App Runner does three things:
Why App Runner? App Runner is App Lego.
If you make many Web apps and you have several of them for example accessing Facebook or using the same type of database, App Runner enables you to architect that in a repeatable pattern. App Runner allows you to use json to configure where code comes from and its settings.
App Runner handles process exceptions and SIGINT.
defaults: options, typically loaded by haraldops
app: Web server, has .on and .get methods
cb(err): optional function
get an api implementation
APIs are either configured directly in opts, or in defaults provided at App Runner init
If module has module.emitter, APp Runner will listen and manage error events
Report any argument as an anomaly, to the log and if so configured a periodcal email.
control emailing on or off: flag: boolean, default: false
Ensures that all callbacks has completed
var haraldutil = require'haraldutil'var cbc = haraldutilgetCbCountersetTimeoutcbcaddcallback 100setTimeoutcbcaddcallback 100if cbcisDoneargumentscalleeconsole.log'All callbacks completed.'else console.log'Not done yet...'
Not done yet...All callbacks completed.
var cbc = getCbCounter(opts)
opts: optional object
opts.emitter: optional event emitter or boolean. default: errors are thrown
opts.callback: function or array of function: add is done for each function
(c) Harald Rudell wrote this for node in September, 2012
No warranty expressed or implied. Use at your own risk.
Please suggest better ways, new features, and possible difficulties on github