danielgtaylor / nesh

An enhanced, extensible interactive shell for Node.js and CoffeeScript
http://danielgtaylor.github.io/nesh/
MIT License
288 stars 27 forks source link

Want to use nesh for interactive shell program #20

Open gerrychristiansen opened 10 years ago

gerrychristiansen commented 10 years ago

I would like to use nesh, embedded as core to an interactive shell app. Similar to node, but instead of evaluating javascript commands, the input commands would be custom commands that would invoke some operation.

for example:

./myprog

run sql 'select avg(x) from table1' 33

Could you provide skeleton prototype or point me in the right direction. Thanks.

ccheever commented 10 years ago

nesh probably won't help you too much with this. It's mostly a wrapper/enhancer of the built-in REPL that node comes with. The place I would start looking is the readline module.

This seems to have some examples: https://gist.github.com/DTrejo/901104