/bootleg

Primary LanguageJavaScriptMIT LicenseMIT

Bootleg

Build Status

Bootleg is an extensible initialization layer for Node.js applications that has been heavily inspired by Bootable.

Bootleg allows initialization phases to be registered for an application. These phases will be executed sequentially during startup, after which the application will be ready to run.

The main difference between Bootleg and Bootable is that Bootleg works with promises to evaluate the execution of phases.

Install

$ npm install bootleg

Usage

const bootleg = require('bootleg');

module.exports = function bootApp() {
const app = bootleg();

// pass the phase name and you're module that you want to execute.
// the module that you require need to be wrapped with function, object module won't work.

app.phase('phase1', require('my_modules/file_name'));

// now you can pass the first module to the next phase as a parameter!

app.phase('phase2', require('my_modules/another_file_name'), @phase1);

return app.boot().then((components) => {
}).done();

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2013 Jared Hanson