Skip to content

ynimjvc/ucli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

modcli

work in progress

Installation

npm i modcli

Getting started

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

Properties

Version

flow.version

Plugins

flow.plugins

Context

flow.context

Methods

Describe

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.

Use

flow.use(callback)

On

flow.on(eventName, callback)

Dispatch

flow.dispatch(eventName)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published