0.2.0 • Published 3 years ago

modcli v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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)
0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago