File tree 1 file changed +3
-2
lines changed 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2534,7 +2534,8 @@ The [`queueMicrotask()`][] API is an alternative to `process.nextTick()` that
2534
2534
also defers execution of a function using the same microtask queue used to
2535
2535
execute the then, catch, and finally handlers of resolved promises. Within
2536
2536
Node.js, every time the "next tick queue" is drained, the microtask queue
2537
- is drained immediately after.
2537
+ is drained immediately after. Note that ` process .nextTick ()` is scheduled
2538
+ differently depending on the module type being used.
2538
2539
2539
2540
` ` ` mjs
2540
2541
import { nextTick } from ' node:process' ;
@@ -2543,9 +2544,9 @@ Promise.resolve().then(() => console.log(2));
2543
2544
queueMicrotask (() => console .log (3 ));
2544
2545
nextTick (() => console .log (1 ));
2545
2546
// Output:
2546
- // 1
2547
2547
// 2
2548
2548
// 3
2549
+ // 1
2549
2550
` ` `
2550
2551
2551
2552
` ` ` cjs
You can’t perform that action at this time.
0 commit comments