remi-runner

A remi extension that allows registering plugins that are returning promises during their registration or are registered synchronously

MIT 6 个版本
安装
npm install remi-runner
yarn add remi-runner
pnpm add remi-runner
bun add remi-runner
README

remi-runner

A remi extension that allows registering plugins that are returning promises during their registration or are registered synchronously

Dependency Status Build Status npm version Coverage Status

Installation

npm install remi-runner

Example Usage

const remi = require('remi')
const remiRunner = require('remi-runner')

const app = {}
const registrator = remi(app)

registrator.hook(remiRunner())

registrator.register([cbPlugin, promisePlugin, syncPlugin])

// a traditional plugin that uses an error-first-callback
// this will work w/o using the remi-runner
function cbPlugin(app, opts, next) {
  // ...
  next()
}

cbPlugin.attributes = { name: 'cbPlugin' }


// a plugin that returns a Promise. This type of plugin will be registered correctly
// only if remi is hooked with remi-runner
function promisePlugin(app, opts) {
  // ...
  return Promise.resolve()
}

cbPlugin.attributes = { name: 'promisePlugin' }


// a synchronous plugin. This type of plugin will be registered correctly
// only if remi is hooked with remi-runner
function syncPlugin(app, opts) {
  // ...
}

cbPlugin.attributes = { name: 'syncPlugin' }

License

MIT © Zoltan Kochan

版本列表
1.1.3 2016-06-09
1.1.2 2016-06-09
1.1.1 2016-06-09
1.1.0 2016-05-21
1.0.0 2016-02-21
0.0.0 2016-01-30