https://github.com/128technology/netconfetti
A Netconf client written in Javascript 🎉
https://github.com/128technology/netconfetti
javascript netconf
Last synced: 6 months ago
JSON representation
A Netconf client written in Javascript 🎉
- Host: GitHub
- URL: https://github.com/128technology/netconfetti
- Owner: 128technology
- Created: 2018-05-14T21:00:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T15:28:10.000Z (about 7 years ago)
- Last Synced: 2025-03-26T03:18:36.106Z (6 months ago)
- Topics: javascript, netconf
- Language: TypeScript
- Homepage:
- Size: 20.5 KB
- Stars: 4
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Netconfetti 🎉 [](https://travis-ci.org/128technology/netconfetti) [](https://www.npmjs.com/package/@128technology/netconfetti)
_It's always a party with NetConf_
Netconfetti is a Javascript client for the NetConf protocol.
## Example
```javascript
const netconfetti = require('@128technology/netconfetti');// Beacuse Netconfetti is promise based, it's extremely easy to utilize it
// in a async/await fashion.
async function main() {
const client = new netconfetti.Client();await client.connect({
host: '127.0.0.1',
username: 'admin',
password: 'admin',
port: 22
});// The RPC method can also take a string
const configResponse = await client.rpc('get-config');
console.log(configResponse.data)// The RPC method can also take an object that will get converted into
// XML via xml2js.Builder.
const doThingsResponse = await client.rpc({
'do-things': {
$: {
xmlns: 'http://special-namespace-here-if-required'
},
'param1': 'hello',
'param2': 'goodbye'
}
});console.log(doThingsResponse.data);
}main().then(
() => process.exit(0),
err => {
console.error(err);
process.exit(1);
});```