📝 Update tutorials to ES6 [ci skip]
This commit is contained in:
parent
3271492c86
commit
55babea2bb
7 changed files with 66 additions and 63 deletions
|
@ -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');
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue