Skip to content

Commit

Permalink
doc,tools: enforce use of node: prefix
Browse files Browse the repository at this point in the history
PR-URL: #53950
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
  • Loading branch information
aduh95 authored and targos committed Sep 21, 2024
1 parent 3b93507 commit 2df7bc0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ import {
executionAsyncId,
executionAsyncResource,
createHook,
} from 'async_hooks';
} from 'node:async_hooks';
const sym = Symbol('state'); // Private symbol to avoid pollution

createHook({
Expand Down
8 changes: 4 additions & 4 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ import {
setTimeout,
setImmediate,
setInterval,
} from 'timers/promises';
} from 'node:timers/promises';
```

```cjs
Expand Down Expand Up @@ -404,7 +404,7 @@ added: v15.0.0
```mjs
import {
setTimeout,
} from 'timers/promises';
} from 'node:timers/promises';

const res = await setTimeout(100, 'result');

Expand Down Expand Up @@ -438,7 +438,7 @@ added: v15.0.0
```mjs
import {
setImmediate,
} from 'timers/promises';
} from 'node:timers/promises';

const res = await setImmediate('result');

Expand Down Expand Up @@ -479,7 +479,7 @@ or implicitly to keep the event loop alive.
```mjs
import {
setInterval,
} from 'timers/promises';
} from 'node:timers/promises';

const interval = 100;
for await (const startTime of setInterval(interval, Date.now())) {
Expand Down
4 changes: 2 additions & 2 deletions doc/api/wasi.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ operating system via a collection of POSIX-like functions.

```mjs
import { readFile } from 'node:fs/promises';
import { WASI } from 'wasi';
import { WASI } from 'node:wasi';
import { argv, env } from 'node:process';

const wasi = new WASI({
Expand All @@ -40,7 +40,7 @@ wasi.start(instance);
```cjs
'use strict';
const { readFile } = require('node:fs/promises');
const { WASI } = require('wasi');
const { WASI } = require('node:wasi');
const { argv, env } = require('node:process');
const { join } = require('node:path');

Expand Down
2 changes: 1 addition & 1 deletion doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ Node.js event loop.
import {
Worker,
isMainThread,
} from 'worker_threads';
} from 'node:worker_threads';

if (isMainThread) {
new Worker(new URL(import.meta.url));
Expand Down

0 comments on commit 2df7bc0

Please sign in to comment.