diff --git a/doc/api/process.md b/doc/api/process.md index 6a82db4d64142a..2a3547b89b3f98 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2534,7 +2534,8 @@ The [`queueMicrotask()`][] API is an alternative to `process.nextTick()` that also defers execution of a function using the same microtask queue used to execute the then, catch, and finally handlers of resolved promises. Within Node.js, every time the "next tick queue" is drained, the microtask queue -is drained immediately after. +is drained immediately after. Note that `process.nextTick()` is scheduled +differently depending on the module type being used. ```mjs import { nextTick } from 'node:process'; @@ -2543,9 +2544,9 @@ Promise.resolve().then(() => console.log(2)); queueMicrotask(() => console.log(3)); nextTick(() => console.log(1)); // Output: -// 1 // 2 // 3 +// 1 ``` ```cjs