jessetane / mikroapi

Minimalist Mikrotik API client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mikroapi

Minimalist Mikrotik API client

Why

The JavaScript client recommended on the wiki doesn't properly specify its dependencies.

How

Just a very basic port of the python implementation shown on the wiki.

Example

const api = new MikroApi({
	host: '1.1.1.1',
	port: 8729,
	username: 'admin',
	password: 'xxx',
	tls: {
		rejectUnauthorized: false // maybe don't do this
	}
})
await api.connect()
const res = await api.exec('/routing/bgp/peer/print', {
	'.proplist': 'prefix-count,disabled,state,uptime,remote-as,remote-address'
})
console.log(res)

License

MIT

About

Minimalist Mikrotik API client


Languages

Language:JavaScript 100.0%