Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telnet-client

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telnet-client - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

15

lib/index.js

@@ -18,3 +18,4 @@ 'use strict'

connect(opts) {
return new Promise((resolve, reject) => {
let promise
return promise = new Promise((resolve, reject) => {
const host = (typeof opts.host !== 'undefined' ? opts.host : '127.0.0.1')

@@ -75,3 +76,3 @@ const port = (typeof opts.port !== 'undefined' ? opts.port : 23)

this.socket.setTimeout(this.timeout, () => {
if (this.socket._connecting === true) {
if (promise.isPending()) {
/* if cannot connect, emit error and destroy */

@@ -93,3 +94,3 @@ if (this.listeners('error').length > 0)

this._parseData(data, (event, parsed) => {
if (event === 'ready') {
if (promise.isPending() && event === 'ready') {
resolve(parsed)

@@ -103,2 +104,4 @@ }

this.emit('error', error)
if (promise.isPending())
reject(error)

@@ -109,2 +112,5 @@ })

this.emit('end')
if (promise.isPending())
reject(new Error('Socket ends'))
})

@@ -114,2 +120,5 @@

this.emit('close')
if (promise.isPending())
reject(new Error('Socket closes'))
})

@@ -116,0 +125,0 @@ })

3

package.json

@@ -8,3 +8,3 @@ {

},
"version": "1.0.2",
"version": "1.0.3",
"main": "./lib/index.js",

@@ -19,3 +19,2 @@ "engine": "node >= 6.9.1",

"extend": "^3.0.2",
"jscoverage": "^0.6.x",
"nodeunit": "^0.11.3",

@@ -22,0 +21,0 @@ "telnet": "0.0.1"

[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/mkozjak/node-telnet-client.svg?branch=master)](https://travis-ci.org/mkozjak/node-telnet-client)
[![Coverage Status](https://coveralls.io/repos/mkozjak/node-telnet-client/badge.svg?branch=master)](https://coveralls.io/r/mkozjak/node-telnet-client?branch=master)
[![npm](https://img.shields.io/npm/dm/telnet-client.svg?maxAge=2592000)](https://www.npmjs.com/package/telnet-client)
[![Donate Bitcoin/Altcoins](https://img.shields.io/badge/donate-coins-blue.svg)](https://mario.kozjak.io/donate)
[![NPM](https://nodei.co/npm/telnet-client.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/telnet-client/)
[![npm version](https://img.shields.io/npm/v/telnet-client.svg?style=flat)](https://www.npmjs.com/package/telnet-client)

@@ -8,0 +7,0 @@ # node-telnet-client

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc