Socket
Book a DemoInstallSign in
Socket

set-immediate-shim

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set-immediate-shim

Simple setImmediate shim

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
1.4M
-37.49%
Maintainers
1
Weekly downloads
 
Created
Source

set-immediate-shim

Simple setImmediate ponyfill

The shim uses the native setImmediate when available (Node.js), falls back to MessageChannel for better performance in environments that support it (modern browsers, Deno), and uses setTimeout with zero delay as a last resort.

Install

npm install set-immediate-shim

Usage

import setImmediateShim from 'set-immediate-shim';

setImmediateShim(() => {
	console.log('2');
});

console.log('1');

//=> 1
//=> 2
  • p-immediate - Returns a promise resolved in the next event loop - think setImmediate()

Keywords

setimmediate

FAQs

Package last updated on 13 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts