expect-telnet
telnet automation through expect-send sequences, like in Tcl.
Installation
$ npm install --save expect-telnet
Examples
Log the output of a command
var et = ; ;
Start an interactive session
var et = ; ;
API
expect-telnet(dest, seq, [opts], cb)
dest
string : Target host and port separated by a colon.seq
array : Array of expect steps (objects).opts
object : Options object.cb
function: Called when an error happens.
Expect step object
expect
string / regexp : String or RegExp to expect.send
string : String to send whenexpect
is found.out
function: Output function, receives the output since the previous step.interact
boolean : Enter interacive mode with stdin/stdout. There's currently no way out of this mode, so this should be last.
Options
timeout
*number: Timeout for connection and expect sequences in milliseconds. Set toinfinity
for no timeout.exit
boolean: Whether to exit the process when interacting ends.
© silverwind, distributed under BSD licence