1.0.1 • Published 4 years ago

lambda-terminal v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

LambdaTerminal

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].

Parameters:

  • hostname - A url/ip to pass to net.createConnection, defaults to localhost.
  • port - A port to pass to net.createConnection, defaults to 3000.
  • waitmode - A wait mode, defaults to RESPONSE

WaitModes:

  • 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

Serverside

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.

1.0.1

4 years ago

1.0.0

4 years ago