been googling for this and searching stackoverflow, but am not coming across anything. I want to develop an interactive shell with node, and wondering on the best approach for this. Is there a library that anyone could recommend to use?
I have written a library, and now want a CLI interface to interact with it, by 2 methods: running the app with parameters, or via interactive shell. e.g.
$ node myapp doSomething
App Result: I did something
$ node myapp cli
Entering interactive mode...
myapp>
myapp> doSomething
App Result: I did something
myapp>
Any suggestions?
I guess commander.js is what you are looking for.
https://github.com/visionmedia/commander.js
http://oscar-mejia.com/blog/how-to-create-a-command-line-program-with-nodejs/
Also have a look at REPL http://nodejs.org/api/repl.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With