Returns a list of devices records provided by udev_enumerate_scan_devices
.
Every device record contains a device.syspath which holds the string for device provided by udev_list_entry_get_name
or udev_device_get_syspath
. The remaining names in the object are provided by udev_device_get_properties_list_entry
.
Creates a monitor you may use to track changes into devices. The presence of a monitor causes node.js to wait instead of exiting after executing your script.
The returned monitor object extends EventEmitter.
If you call this function like this: var monitor = udev.monitor();
, you may then do some of the following:
Closes the monitor you created. It stops listening for new events.
Indicates whether a device was removed, added or changed. Every event provides a device record. Example use:
monitor.on('add', function(device) {
console.log(device.syspath);
});