1.0.0 • Published 6 years ago

cli-manager v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

CLI-MANAGER

github

Simple CLI manager with STATE and help

Features

  • State with self commands
  • Commands have self callback
  • Commands change state instance
  • Simple Builder usage
  • Output help for each command

Usage

    import CLI from 'cli-manager'
    import { ICbInput, ICliListener } from 'cli-manager'

    let cli = new CLI()

    cli.setState('abc')
        .add('change', (input: ICbInput) => {
            console.log(input.state)
            cli.setState('idle')
            console.log(input.cli.INIT_MESSAGE)
        }, 'change\thelp for some command')
        .setState('idle')
        .add('change', (input: ICbInput) => {
            console.log(input.state)
            input.cli.setState('abc')
            console.log(input.cli.INIT_MESSAGE)
        })

    cli.run() //starting listen console input