1.1.0 • Published 8 years ago

remi-dependencies v1.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

remi-dependencies

A remi hook to add dependencies to remi plugins

npm version Build Status Coverage Status

Installation

npm install --save remi remi-dependencies

Example Usage

const remi = require('remi')
const remiDependencies = require('remi-dependencies')

const app = {}
const registrator = remi(app)
registrator.hook(remiDependencies())

You can specify plugin dependencies in you attributes and remi-dependencies will throw an error if the dependencies were not registered in time.

// main.js
module.exports = function(app, opts, next) {
  // ...
  next()
}
module.exports.attributes = {
  name: 'main',
}

// dependent.js
module.exports = function(app, opts, next) {
  // ...
  next()
}
module.exports.attributes = {
  name: 'dependent',
  dependencies: ['main'],
}

// if 'main' will be registered before 'dependent' then everything will be OK
registrator.register([main, dependent]).then(() => console.log('OK'))

// however, if dependent will be registered before main, an error will be thrown
registrator.register([dependent, main]).catch(err => console.error(err))

License

MIT © Zoltan Kochan


Dependencies dependency status

None

Dev Dependencies devDependency status

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • istanbul: Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests
  • mocha: simple, flexible, fun test framework
  • mos: A pluggable module that injects content into your markdown files via hidden JavaScript snippets
  • mos-plugin-readme: A mos plugin for generating README
  • plugiator: hapi plugins creator
  • remi: A plugin registrator.
1.1.0

8 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago