process.nextTick()

A Node.js function that queues a callback to run as soon as the current operation finishes, before promise callbacks and before the event loop continues.

In more detail

The nextTick queue is drained completely before the promise microtask queue. Recursive nextTick calls therefore starve the event loop, and the old process.maxTickDepth safeguard no longer exists. Prefer queueMicrotask() or setImmediate() unless you really need this ordering.

Related terms

Taught in

References