2013-09-09 07:35:57 +00:00
|
|
|
# power-monitor
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2013-08-29 14:37:51 +00:00
|
|
|
The `power-monitor` module is used to monitor the power state change, you can
|
|
|
|
only use it on the browser side.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
|
|
|
An example is:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
require('power-monitor').on('suspend', function() {
|
|
|
|
console.log('The system is going to sleep');
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
## Event: suspend
|
|
|
|
|
|
|
|
Emitted when the system is suspending.
|
|
|
|
|
|
|
|
## Event: resume
|
|
|
|
|
2013-08-29 14:37:51 +00:00
|
|
|
Emitted when system is resuming.
|