work in progress
npm i modcli
const flow = require('modcli');
flow()
.use(flow => {
flow.describe('key', 'description');
flow.on('event', (...args) => {
console.log(args);
});
flow.dispatch('event', 'foo', 'bar');
})
.dispatch('event', 'foo', 'bar')
.describe('key', 'description')
.on('event', (...args) => {
console.log(args);
});
flow.version
flow.plugins
flow.context
flow.describe(name, value)
Use this to describe any new features you added.
One describe per feature.
Underneath its jus a javascript Map and can be accessed on flow.
Use flow.getDescription(key)
for getting value for specific key or flow.plugins
for getting all registered descriptions.
flow.use(callback)
flow.on(eventName, callback)
flow.dispatch(eventName)