Parameters options to be passed down to ip
.
Global parameters options that affects the command execution.
ParametersError - Throws when passed parameters are invalid.
CommandError - Throws when the executed command fails.
Import module
import { monitor } from 'iproute';
Monitor all objects state changes
monitor({
object: MonitorObjects.All
});
After starting the monitor, you can start watching for changes
let command: MonitorCommand<MonitorOptions>;
monitor({
object: MonitorObjects.All
})
.then((_command) => {
command = _command;
command.on(MonitorObjects.All, (data: MonitorEmittedData) => {
// Do something with `data`.
});
command.on('error', (error) => {
// Do something with `data`.
});
});
setTimeout(() => {
command.close();
}, 5000);
Generated using TypeDoc
State monitoring.