1.2.0 • Published 3 years ago
modcli-actionrouter v1.2.0
Action router
Gets first argument from command line and uses it to dispatch events according to routing config.
Install
npm install modcli-actionrouter
Getting started
Config should be an object with at least one property.
fallbacks
- Default - If no matches found router searches for
default
option. - First - If no matches found and no default option found router uses first key in router config;
usage
const {app} = require('modcli');
const router = require('modcli-actionrouter');
router({
myAction: 'event',
defaulf: 'event'
});
app();