telnet-client
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"main": "./lib/telnet-client.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 0.10.29", |
@@ -110,2 +110,37 @@ [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE) | ||
### Async/Await (using babeljs) | ||
```js | ||
'use strict' | ||
const Promise = require('bluebird') | ||
const telnet = require('telnet-client') | ||
require('babel-runtime/core-js/promise').default = Promise | ||
Promise.onPossiblyUnhandledRejection(function(error) { | ||
throw error | ||
}) | ||
// also requires additional babeljs setup | ||
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(cmd) | ||
console.log('async result:', res) | ||
} | ||
run() | ||
``` | ||
## API | ||
@@ -112,0 +147,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
253
24869
10
416