Name Last Update
..
example Loading commit data...
intl Loading commit data...
lib Loading commit data...
node_modules Loading commit data...
.jshintignore Loading commit data...
.jshintrc Loading commit data...
.npmignore Loading commit data...
CHANGES.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
docs.json Loading commit data...
index.js Loading commit data...
package.json Loading commit data...

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

This module is provided under dual MIT/StrongLoop license. See LICENSE for details.