telnet-client
Advanced tools
Comparing version 0.15.1 to 0.15.2
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.15.1", | ||
"version": "0.15.2", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 6.9.1", |
@@ -32,7 +32,33 @@ [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE) | ||
## Usage example | ||
### Async/Await (Node.js >= 7.6.0) | ||
```js | ||
'use strict' | ||
const Telnet = require('telnet-client') | ||
async function run() { | ||
let connection = new Telnet() | ||
let params = { | ||
host: '127.0.0.1', | ||
port: 23, | ||
shellPrompt: '/ # ', | ||
timeout: 1500 | ||
} | ||
await connection.connect(params) | ||
let res = await connection.exec('uptime') | ||
console.log('async result:', res) | ||
} | ||
run() | ||
``` | ||
### Callback-style | ||
```js | ||
var telnet = require('telnet-client') | ||
var connection = new telnet() | ||
var Telnet = require('telnet-client') | ||
var connection = new Telnet() | ||
@@ -68,4 +94,4 @@ var params = { | ||
```js | ||
var telnet = require('telnet-client') | ||
var connection = new telnet() | ||
var Telnet = require('telnet-client') | ||
var connection = new Telnet() | ||
@@ -96,4 +122,4 @@ var params = { | ||
var bluebird = require('bluebird') | ||
var telnet = require('telnet-client') | ||
var connection = new telnet() | ||
var Telnet = require('telnet-client') | ||
var connection = new Telnet() | ||
@@ -142,3 +168,3 @@ var params = { | ||
async function run() { | ||
let connection = new telnet() | ||
let connection = new Telnet() | ||
@@ -164,4 +190,4 @@ let params = { | ||
```js | ||
var telnet = require('telnet-client') | ||
var connection = new telnet() | ||
var Telnet = require('telnet-client') | ||
var connection = new Telnet() | ||
``` | ||
@@ -168,0 +194,0 @@ |
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
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
43980
18
947
312