-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Trakkasure/master
New release 2.5.6
- Loading branch information
Showing
5 changed files
with
51 additions
and
1,299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
var MikroNode = require('../dist/mikronode.js'); | ||
// Create API instance to a host. | ||
var device = new MikroNode('10.10.10.10'); | ||
// device.setDebug(MikroNode.DEBUG); | ||
|
||
// Connect to MikroTik device | ||
device.connect().then(([login])=>login('admin','password')).then(conn=>{ | ||
// When all channels are marked done, close the connection. | ||
console.log('connected'); | ||
|
||
conn.closeOnDone(true); | ||
|
||
var channel1=conn.openChannel(); | ||
channel1.closeOnDone(true); | ||
|
||
console.log('going write 1'); | ||
|
||
// get only a count of the addresses. | ||
channel1.write('/ip/address/print',{ | ||
'=count-only=':'' | ||
}).then(data=>{ | ||
console.log("Done",JSON.stringify(data)); | ||
}).catch(error=>{ | ||
console.log("Error result ",error); | ||
}); | ||
console.log('Wrote'); | ||
} | ||
).catch(error=>{ | ||
console.log("Error logging in ",error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
{ | ||
"name": "mikronode", | ||
"description": "Mikrotik API implemented in Node", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"author": "Brandon Myers <[email protected]>", | ||
"scripts": { | ||
"prebuild": "pegjs src/parser.g", | ||
"build": "webpack --color --progress", | ||
"dev": "webpack --watch --color -d --progress", | ||
"compile:debug": "f(){ webpack --entry=\"$1\" --output-path=./.compiled --output-filename=debug.js; };f", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.