Package Exports
- expect-telnet
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expect-telnet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
expect-telnet

telnet automation through expect-send sequences, like in Tcl.
Installation
$ npm install --save expect-telnetExamples
var et = require("expect-telnet");
// connect, log in, run a command and exit after logging its output.
et("1.2.3.4:23", [
{expect: "Username", send: "username\r"},
{expect: "Password", send: "password\r"},
{expect: "#" , send: "command\r" },
{expect: "#" , out: console.log, send: "exit\r"}
], console.error);
// connect, log in and start an interactive session.
et("1.2.3.4:23", [
{expect: "Username", send: "username\r"},
{expect: "Password", send: "password\r"},
{expect: "#" , interact: true }
], {exit: true}, console.error);API
expect-telnet(host, dest, seq, [opts], cb)
deststring : Target host and port separated by a colon.seqarray : Array of expect steps (objects).optsobject : Options object.cbfunction: Called when an error happens.
Expect step object
expectstring : String to expect.sendstring : String to send whenexpectis found.outfunction: Output function, receives the output since the previous step.interactboolean : Enter interacive mode with stdin/stdout. There's currently no way out of this mode, so this should be last.
Options
exitboolean: Wether to exit the process when interacting ends. © 2015 silverwind, distributed under BSD licence