0.1.0 • Published 9 years ago
emese v0.1.0
emese
Emese aims to help you initialize and load large Node.js projects.
Usage
var api = {
version: '0.0.1',
log: log
};
var loader = new Emese(api);
loader.resources({
client: {
rest: 'test/client/rest/*.js',
soap: 'test/client/soap/*.js'
},
common: 'test/common/*.js',
plugin: 'test/plugin/*.js',
service: 'test/service/*.js',
transformer: 'test/transformer/*.js'
});
loader.addTask([
function (next) {
log('Opening database connection');
setTimeout(function () {
log('Connected to the database');
next();
}, 150);
},
function (next) {
log('Initializing cache');
setTimeout(function () {
log('Cache initialized');
next();
}, 200);
},
function (next) {
api.plugin.server.load(next);
}
]);
loader.resources({
public: 'test/public/**/*.json'
});
loader.load();
loader.on('error', function (err) {
log('ERROR!');
log(err);
});
loader.on('done', function (api) {
log('Your application is ready to serve');
debug(api);
});