NPM based plugin framework for NodeJS.
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.
Install nplugm
by running:
$ npm install --save nplugm
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}")
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Run the test suite by doing:
$ gulp test
- Issue Tracker: github.com/resin-io/nplugm/issues
- Source Code: github.com/resin-io/nplugm
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
The project is licensed under the MIT license.