3 ms·
I get you. Yes, it does combined readline and optparse-type functionality. It's similar to Commander.js, with the exception that you have the option of staying
by dc2 11y ago
I get you. Yes, it does combined readline and optparse-type functionality. It's similar to Commander.js, with the exception that you have the option of staying in the "shell" after the first command executes, and then it is its own environment with its own commands.
On piping, I hard coded those to keep it short. Every single command can receive "args.stdin", which is a stdin stream from previous commands. To pipe out, the "this.log" command does all of the heavy lifting.
So all you would need to do is expect both "args.stdin" and "args.words" - that would cover input both from a directly executed command as well as stdin. This works very well in practice.