LambdaTerminal is a small project that runs a command line-ish thing over TCP.
Telnet is cool and all, but hard to parse commands from because of the ANSI escaping, and sending every character you press.
LambdaTerminal accepts user input and sends it when you press enter, and automatically handles parsing and sending for you.
To use LambdaTerminal, install it by entering npm install --global lambda-terminal
in your command line, once it finishes, you can type lambdaterm [hostname] [port] [waitmode]
.
- hostname - A url/ip to pass to
net.createConnection
, defaults tolocalhost
. - port - A port to pass to
net.createConnection
, defaults to3000
. - waitmode - A wait mode, defaults to
RESPONSE
- 50MS - Give the server 50 milliseconds to respond before prompting again (response is not discarded past 50ms)
- RESPONSE - Wait for a response from the server
- Anything else - Keep entering commands and show whenever the server responds
Everything is UTF-8.
There are a few commands, to specify a command, send the client a string following the following the following format: :::commandname:arg1:arg2:etc
.
Supported commands:
- :::setwaitmode:waitmode string - Set the waitmode
- :::setprompt:prompt string - Set the prompt
- :::resetprompt - Reset the prompt to default
- :::disconnect - Cleanly ask the client to disconnect
Note: ANSI Escape Codes do work if you wan't to do special terminal stuff.