ez-commander

A NodeJS module for an easy interactive commandline


Keywords
cli, commandline, commander
License
MIT
Install
npm install ez-commander@0.1.2

Documentation

EzCommander

A NodeJS module for an easy interactive commandline.

  • EzCommander(trail:String[default: ">"], stdin:Stream[default: process.stdin], stdout:Stream[default: process.stdout])
    • destroy():void // Stop EzCommander

Example

const EzCommander = require('ez-commander');

let commander = new EzCommander();

commander.on('reload', ()=>{
  console.log('You want to reload, huh?');
});

commander.on('report', (name) => {
  console.log('Oh, you want to report "'+name+'" huh?');
});

Output:

Oh, you want to report "nobody" huh?
> report nobody

But Freehunt! Whats the point of this?

This module is like a console without history!
Your console output wont interrupt your commandline input.
This way you can easily give your servers the possibility to accept commands.

For example to reload plugins.