You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

expect-telnet

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-telnet - npm Package Compare versions

Comparing version

to
0.5.0

13

index.js

@@ -54,3 +54,14 @@ "use strict";

saved += chunk;
if (saved.indexOf(seq[i].expect) !== -1) {
var matched;
if (seq[i].expect instanceof RegExp) {
matched = seq[i].expect.test(saved);
} else if (typeof seq[i].expect === "string") {
matched = saved.indexOf(seq[i].expect) !== -1;
} else {
endSocket(socket);
cb(new Error("Expected a String or RegExp:" + seq[i].expect));
}
if (matched) {
clearTimeout(seq[i].timeout);

@@ -57,0 +68,0 @@ seq[i].done = true;

2

package.json
{
"name": "expect-telnet",
"version": "0.4.1",
"version": "0.5.0",
"description": "telnet automation through expect-send sequences, like in Tcl",

@@ -5,0 +5,0 @@ "author": "silverwind <me@silverwind.io> (https://github.com/silverwind)",

@@ -45,3 +45,3 @@ # expect-telnet [![NPM version](https://img.shields.io/npm/v/expect-telnet.svg?style=flat)](https://www.npmjs.org/package/expect-telnet) [![Dependency Status](http://img.shields.io/david/silverwind/expect-telnet.svg?style=flat)](https://david-dm.org/silverwind/expect-telnet)

#### Expect step object
- `expect` *string* : String to expect.
- `expect` *string* / *regexp* : String or RegExp to expect.
- `send` *string* : String to send when `expect` is found.

@@ -48,0 +48,0 @@ - `out` *function*: Output function, receives the output since the previous step.