docs: use node: imports for node core modules (#39681)

docs: use `node:` imports for node builtin modules
This commit is contained in:
Erick Zhao 2023-08-30 08:55:23 -07:00 committed by GitHub
parent 2182202e8e
commit b8ac798344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 39 additions and 39 deletions

View file

@ -42,14 +42,14 @@ $ asar list /path/to/example.asar
Read a file in the ASAR archive:
```javascript
const fs = require('fs')
const fs = require('node:fs')
fs.readFileSync('/path/to/example.asar/file.txt')
```
List all files under the root of the archive:
```javascript
const fs = require('fs')
const fs = require('node:fs')
fs.readdirSync('/path/to/example.asar')
```
@ -99,7 +99,7 @@ You can also set `process.noAsar` to `true` to disable the support for `asar` in
the `fs` module:
```javascript
const fs = require('fs')
const fs = require('node:fs')
process.noAsar = true
fs.readFileSync('/path/to/example.asar')
```