mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
📝 Update tutorials to ES6 [ci skip]
This commit is contained in:
@@ -71,8 +71,8 @@ require('/path/to/example.asar/dir/module.js');
|
||||
You can also display a web page in an `asar` archive with `BrowserWindow`:
|
||||
|
||||
```javascript
|
||||
const BrowserWindow = require('electron').BrowserWindow;
|
||||
var win = new BrowserWindow({width: 800, height: 600});
|
||||
const { BrowserWindow } = require('electron');
|
||||
let win = new BrowserWindow({width: 800, height: 600});
|
||||
win.loadURL('file:///path/to/example.asar/static/index.html');
|
||||
```
|
||||
|
||||
@@ -86,7 +86,7 @@ For example, to get a file with `$.get`:
|
||||
```html
|
||||
<script>
|
||||
var $ = require('./jquery.min.js');
|
||||
$.get('file:///path/to/example.asar/file.txt', function(data) {
|
||||
$.get('file:///path/to/example.asar/file.txt', (data) => {
|
||||
console.log(data);
|
||||
});
|
||||
</script>
|
||||
@@ -99,7 +99,7 @@ content of `asar` archive as file. For this purpose you can use the built-in
|
||||
`original-fs` module which provides original `fs` APIs without `asar` support:
|
||||
|
||||
```javascript
|
||||
var originalFs = require('original-fs');
|
||||
const originalFs = require('original-fs');
|
||||
originalFs.readFileSync('/path/to/example.asar');
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user