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
|
@ -78,11 +78,12 @@ The `main.js` should create windows and handle system events, a typical
|
|||
example being:
|
||||
|
||||
```javascript
|
||||
var app = require('app'); // Module to control application life.
|
||||
var BrowserWindow = require('browser-window'); // Module to create native browser window.
|
||||
const electron = require('electron');
|
||||
const app = electron.app; // Module to control application life.
|
||||
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
|
||||
|
||||
// Report crashes to our server.
|
||||
require('crash-reporter').start();
|
||||
electron.crashReporter.start();
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue