docs: Update codes in docs to use require('electron')
This commit is contained in:
parent
8b2942c279
commit
eac2e7cc61
32 changed files with 134 additions and 157 deletions
|
@ -1,4 +1,4 @@
|
|||
# power-monitor
|
||||
# powerMonitor
|
||||
|
||||
The `power-monitor` module is used to monitor power state changes. You can
|
||||
only use it in the main process. You should not use this module until the `ready`
|
||||
|
@ -7,10 +7,8 @@ event of the `app` module is emitted.
|
|||
For example:
|
||||
|
||||
```javascript
|
||||
var app = require('app');
|
||||
|
||||
app.on('ready', function() {
|
||||
require('power-monitor').on('suspend', function() {
|
||||
require('electron').powerMonitor.on('suspend', function() {
|
||||
console.log('The system is going to sleep');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue