patriot
Version:
Patriot command-line interface and node.js library.
55 lines (43 loc) • 1.33 kB
JavaScript
/*!
* Module dependencies.
*/
var events = require('events'),
util = require('util');
/**
* Patriot object.
*
* Events:
*
* - `error` {Event} triggered with info compatible with console.error.
* - `e` {Error} describes the error.
* - `log` {Event} triggered with info compatible with console.log.
* - `warn` {Event} triggered with info compatible with console.warn.
* - `raw` {Event} trigger with info that should not be formatted.
* - `login` {Event} triggered when login credentials are needed.
* - `callback` {Function} is triggered with user credentials
* - `username` {String}
* - `password` {String}
*/
function Patriot() {
// initialize Patriot
initialize.call(this);
// initialize each command and inject the `patriot` dependency.
this.build = require('./patriot/build').create(this);
this.create = require('./patriot/create').create(this);
this.serve = require('./patriot/serve').create(this);
this.version = require('./patriot/version').create(this);
}
util.inherits(Patriot, events.EventEmitter);
/*!
* Initialize Patriot.
*/
function initialize() {
var self = this;
// error events must always have a listener.
self.on('error', function (e) {
});
}
/*!
* Expose the Patriot object.
*/
module.exports = Patriot;