There would be a difference in output here between using commonJS versus using ESM in your project. ES modules are promise-based so, promise microtask queue is exhausted first in this case. Whereas commonJS has the traditional Node.js execution environment and nextTick takes priority here as mentioned in the Node.js docs.