Phase management for LoopBack applications.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
example
intl
lib
test
.gitignore
.jshintignore
.jshintrc
.npmrc
.travis.yml
CHANGES.md
CODEOWNERS
CONTRIBUTING.md
LICENSE
README.md
docs.json
index.js
package.json

README.md

LoopBack Phase

Hook into the various phases of a LoopBack application.

Installation

npm install loopback-phase

Usage

var PhaseList = require('loopback-phase').PhaseList;
var phases = new PhaseList();
phases.add('first');
phases.add('second');
phases.add('third');

var first = phases.find('first');
var second = phases.find('second');

first.use(function(ctx, cb) {
  console.log('this is the first phase!');
  cb();
});

second.use(function(ctx, cb) {
  console.log('this is the second phase!');
  cb();
});

phases.run(ctx);

See API docs for complete API reference.

License

MIT.