import {
setImmediate,
} from 'node:timers/promises';
const res = await setImmediate('result');
console.log(res); // Prints 'result'
function
timers.promises.setImmediate
value?: T,
): Promise<T>;
@param value
A value with which the promise is fulfilled.
Referenced types
interface TimerOptions
- ref?: boolean
Set to
falseto indicate that the scheduledTimeoutshould not require the Node.js event loop to remain active.