包详细信息

loopback-phase

strongloop101.9kMIT3.4.0

Hook into a LoopBack application's phases

StrongLoop, LoopBack, Hook, Phase

自述文件

LoopBack Phase

⚠️ LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical security fixes will be provided. (See Module Long Term Support Policy below.)

We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as soon as possible. Refer to our Migration Guide for more information on how to upgrade.

Overview

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.

Module Long Term Support Policy

This module adopts the Module Long Term Support (LTS) policy, with the following End Of Life (EOL) dates:

Version Status Published EOL
3.x Maintenance LTS Dec 2016 Dec 2020
1.x End-of-Life Oct 2014 Apr 2019

Learn more about our LTS plan in the docs.

更新日志

2020-03-06, Version 3.4.0

  • Update LTS status in README (Miroslav Bajtoš)

  • chore: improve issue and PR templates (Nora)

  • add Node.js 12 to travis (Nora)

  • drop Node.js 6 support (Nora)

  • chore: update copyrights years (Agnes Lin)

  • add lts annoucement (jannyHou)

2018-07-09, Version 3.3.0

  • [WebFM] cs/pl/ru translation (candytangnb)

2018-06-12, Version 3.2.0

  • Update dependencies (Miroslav Bajtoš)

  • Disable package-lock feature of npm (Miroslav Bajtoš)

  • Travis: add Node.js 10.x to the build matrix (Miroslav Bajtoš)

  • Drop support for Node 4.x (Miroslav Bajtoš)

  • Update LICENSE (Diana Lau)

2017-10-13, Version 3.1.0

  • update strong-globalize to 3.1.0 (shimks)

  • Create Issue and PR Templates (#24) (Sakib Hasan)

  • Add CODEOWNER file (Diana Lau)

  • Update translated strings Q3 2017 (Allen Boone)

  • update translation file (Diana Lau)

  • add .travis.yml (Diana Lau)

  • Replicate new issue_template from loopback (Siddhi Pai)

  • Replicate issue_template from loopback repo (Siddhi Pai)

  • Update README.md (Rand McKinney)

2016-12-21, Version 3.0.0

  • Update paid support URL (Siddhi Pai)

  • Start 3.x + drop support for Node v0.10/v0.12 (siddhipai)

  • Drop support for Node v0.10 and v0.12 (Siddhi Pai)

  • Start the development of the next major version (Siddhi Pai)

2016-10-07, Version 1.4.1

  • Update translation files - round#2 (Candy)

  • Add translation files (gunjpan)

2016-09-05, Version 1.4.0

  • Add globalization (Simon Ho)

  • Update URLs in CONTRIBUTING.md (#11) (Ryan Graham)

2016-05-06, Version 1.3.1

  • update copyright notices and license (Ryan Graham)

2016-02-01, Version 1.3.0

  • Add "phaseList.registerHandler" (Miroslav Bajtoš)

  • Refer to licenses with a link (Sam Roberts)

  • Use strongloop conventions for licensing (Sam Roberts)

  • Remove internal API doc (Rand McKinney)

2014-12-11, Version 1.2.0

  • phase-list: expose zipMerge via public API (Miroslav Bajtoš)

  • gitignore: ignore common stuff (Miroslav Bajtoš)

2014-11-13, Version 1.1.0

  • Bump version and update deps (Raymond Feng)

  • Fix the example (Raymond Feng)

  • Add options to create a Phase that run handlers in parallel (Raymond Feng)

  • phase-list: implement .zipMerge(names) (Miroslav Bajtoš)

  • phase-list: prevent re-adding of existing phase (Miroslav Bajtoš)

  • phase-list: implement more flavours of add (Miroslav Bajtoš)

  • test: code cleanup (Miroslav Bajtoš)

  • Fix jshint setup and warnings (Miroslav Bajtoš)

2014-11-06, Version 1.01

  • PhaseList: fix run() and unit-tests (Miroslav Bajtoš)

  • Add missing jshint files (Raymond Feng)

2014-10-22, Version 1.0.0

  • First release!