nplugm

3.0.5 • Public • Published

nplugm

npm version dependencies Build Status Build status

NPM based plugin framework for NodeJS.

Introduction

The purpose of this module is to provide an easy way to scan the system for globally installed npm packages that match a certain regular expression, so the application can require them and register them as plugins.

Installation

Install nplugm by running:

$ npm install --save nplugm

Documentation

nplugm.list([regex]) ⇒ Promise.<Array.<String>>

If regex is a String, it will match all the plugins that start with it.

Kind: static method of nplugm
Summary: List matching installed plugins
Returns: Promise.<Array.<String>> - plugins
Access: public

Param Type Default Description
[regex] RegExp | String /.*/ plugin matcher

Example

nplugm.list(/^my-plugin-(\w+)$/).map (plugin) ->
    import = require(plugin)
    console.log("Registering: #{plugin}")

Support

If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

License

The project is licensed under the MIT license.

Package Sidebar

Install

npm i nplugm

Weekly Downloads

0

Version

3.0.5

License

MIT

Last publish

Collaborators

  • jviotti