@128technology/netconfetti 中文文档教程
Netconfetti
它始终是 NetConf 的派对
Netconfetti 是 NetConf 协议的 Javascript 客户端。
Example
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);
});
Netconfetti ????
It's always a party with NetConf
Netconfetti is a Javascript client for the NetConf protocol.
Example
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);
});
更多
你可能也喜欢
- 1-line-opening-hours 中文文档教程
- @1hive/hardhat-aragon 中文文档教程
- @4geit/rct-author-component 中文文档教程
- @59naga/babel-plugin-transform-string-raw 中文文档教程
- @63pokupki/yandex-map 中文文档教程
- @8base/web-api-token-auth-client 中文文档教程
- @_giobbi/g-cli-search 中文文档教程
- @aakash-goel/number-formatter 中文文档教程
- @abcnews/alternating-case-to-object 中文文档教程
- @abdul778/react-calendar-timeline 中文文档教程