https://github.com/distributedlife/plug-n-play
A plugin system based around the concept of roles.
https://github.com/distributedlife/plug-n-play
Last synced: 11 months ago
JSON representation
A plugin system based around the concept of roles.
- Host: GitHub
- URL: https://github.com/distributedlife/plug-n-play
- Owner: distributedlife
- Created: 2015-04-11T04:56:20.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-09T22:08:00.000Z (almost 11 years ago)
- Last Synced: 2025-02-19T12:53:37.205Z (over 1 year ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# plug-n-play
# usage
```javascript
var plugins = require('plug-n-play').configure(['Set']);
plugins.load(require('/path/to/set/plugin'));
plugins.load({
type: 'MySweetPlugin'
deps: ['Set']
func: function(set) {
return {
count: function () {
return set().length;
}
}
};
});
var define = plugins.get('DefinePlugin');
define('Set', function() {
return 4;
});
var mySweetPlugin = plugins.get('MySweetPlugin');
mySweetPlugin.count();
```