|
@@ -19,7 +19,7 @@ scripts to be able to use those modules.
|
|
|
The main process script is just like a normal Node.js script:
|
|
|
|
|
|
```javascript
|
|
|
-const { app, BrowserWindow } = require('electron');
|
|
|
+const {app, BrowserWindow} = require('electron');
|
|
|
|
|
|
let window = null;
|
|
|
|
|
@@ -37,8 +37,8 @@ extra ability to use node modules:
|
|
|
<html>
|
|
|
<body>
|
|
|
<script>
|
|
|
- const { remote } = require('electron');
|
|
|
- console.log(remote.app.getVersion());
|
|
|
+ const {app} = require('electron').remote;
|
|
|
+ console.log(app.getVersion());
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|
|
@@ -53,7 +53,7 @@ As of 0.37, you can use
|
|
|
built-in modules.
|
|
|
|
|
|
```javascript
|
|
|
-const { app, BrowserWindow } = require('electron');
|
|
|
+const {app, BrowserWindow} = require('electron');
|
|
|
```
|
|
|
|
|
|
If you need the entire `electron` module, you can require it and then using
|
|
@@ -61,7 +61,7 @@ destructuring to access the individual modules from `electron`.
|
|
|
|
|
|
```javascript
|
|
|
const electron = require('electron');
|
|
|
-const { app, BrowserWindow } = electron;
|
|
|
+const {app, BrowserWindow} = electron;
|
|
|
```
|
|
|
|
|
|
This is equivalent to the following code:
|