diff --git a/README.md b/README.md index d668190..c673979 100644 --- a/README.md +++ b/README.md @@ -7,41 +7,46 @@ Code: - var control = new ControlPort(); - control.start(6000); + var control = new ControlPort(); + control.start(6000); - control.register('add', function (a,b) { - return (a+b); - }); - - control.register('shutdown', function () { - process.exit(0); - }); - control.register('menu') function () { - var out = '--- Menu ---\n\tshutdown - Kills the process\n'; - out+= '\tadd - Adds the arguments\n'; - }); + control.register('add', function (a,b) { + return (a+b); + },'Adds two numbers'); + control.register('shutdown', function () { + process.exit(0); + }'Shuts down process'); In action: - $ nc localhost 6000 - Node> menu - --- Menu --- - shutdown - Kills the process - add - Adds the arguments - Node> add 2 3 - 5 - Node> shutdown - $ + $ nc localhost 6000 + Node> menu + --- Menu --- + + add - Adds two numbers + + shutdown - Shuts down process + + Node> add 2 3 + 5 + Node> shutdown + $ ## Features - Set your own Prompt - +* Set your own Prompt! + var control = new ControlPort('Server4'); - - Auto argument parsing: - arg1, arg2, and arg3 will be passed to command callback + +* Unlimited Commands! + + control.register(name, callback, menuDescription); + +* Auto Menu Generation! + +* Auto argument parsing: + + arg1, arg2, and arg3 will be passed to command callback - Node> command arg1 arg2 arg3 + Node> command arg1 arg2 arg3