1.3.0 • Published 6 years ago
extendme v1.3.0
Extendme library
Easily extend your js application
Usage
import Pluggable from 'extendme';
// Main bus
const p = new Pluggable();
p.on('action', (data) => {
return new Promise(function (resolve, reject) {
resolve(data + 2);
});
// or
return data + 2;
});
p.emit('action', data)
// Plugins
const someSuperPlugin = function (p) {
p.on(...)
};
someSuperPlugin.plugin = {
name: 'test-name',
version: '1.0.0', // x or x.x or x.x.x
dependencies: {
'some-other-plugin': '1.0'
}
};
p.plugin(someSuperPlugin);
Build
Use lts/carbon to build.