telnet-client
Advanced tools
Comparing version 0.11.0 to 0.11.1
49
app.js
@@ -1,20 +0,39 @@ | ||
var telnet = require('./lib') | ||
var t = require('./lib/index') | ||
var c = new t() | ||
var connection = new telnet() | ||
connection.connect({ | ||
var params = { | ||
host: '127.0.0.1', | ||
port: 1337, | ||
execTimeout: 1000, | ||
port: 8080, | ||
negotiationMandatory: false | ||
}).then(function() { | ||
connection.send('hi') | ||
.then(function(res) { | ||
console.log(res) | ||
}, function(error) { | ||
console.log(error) | ||
} | ||
c.on('failedlogin', function() { | ||
console.log('login failed') | ||
}) | ||
/* | ||
c.on("connect", function() { | ||
console.log('sending data') | ||
c.send('something', { | ||
ors: '\r\n', | ||
waitfor: '\n' | ||
}, function(error, data) { | ||
console.log('received a response', data) | ||
}) | ||
}) | ||
*/ | ||
c.connect(params).then(function() { | ||
setInterval(function() { | ||
console.log('sending') | ||
c.send('something', { | ||
ors: '\r\n', | ||
waitfor: '\n' | ||
}, function(error, data) { | ||
console.log('received a response:', error, data) | ||
}) | ||
.catch(function(error) { | ||
console.log(error) | ||
}) | ||
}, 2000) | ||
}) |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 6.9.1", |
@@ -20,2 +20,11 @@ [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE) | ||
## Responsible disclosure | ||
Since version 0.11.x, we have moved from using ```new Buffer``` to ```Buffer.from```, | ||
because when the library is used with latest Node.js, it issues a deprecation warning | ||
(see [PR #63](https://github.com/mkozjak/node-telnet-client/pull/63)). | ||
This means we have moved exclusively to Current and LTS Node.js releases. | ||
Should there be any problems with it, please check if the corresponding issue is opened, | ||
and if not, open the issue so we can reach out and try to solve the deprecation problem. | ||
## Usage example | ||
@@ -22,0 +31,0 @@ ### Callback-style |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129196
12
932
265
6