FsetImmediate
Bun

function

timers.promises.setImmediate

function setImmediate<T = void>(
value?: T,
options?: TimerOptions
): Promise<T>;
import {
  setImmediate,
} from 'node:timers/promises';

const res = await setImmediate('result');

console.log(res);  // Prints 'result'
@param value

A value with which the promise is fulfilled.

Referenced types

interface TimerOptions

  • ref?: boolean

    Set to false to indicate that the scheduled Timeout should not require the Node.js event loop to remain active.