
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
set-immediate-shim
Advanced tools
Simple
setImmediateponyfill
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.
npm install set-immediate-shim
import setImmediateShim from 'set-immediate-shim';
setImmediateShim(() => {
console.log('2');
});
console.log('1');
//=> 1
//=> 2
setImmediate()core-js is a modular standard library for JavaScript, which includes polyfills for ECMAScript up to 2021. It offers a `setImmediate` polyfill among many others, providing a broader scope of functionality compared to set-immediate-shim. While set-immediate-shim focuses solely on `setImmediate`, core-js covers a wide range of ECMAScript features, making it a more comprehensive solution for cross-environment compatibility.
The process package is a browserify implementation of the Node.js 'process' module, which includes a nextTick method that can be used similarly to `setImmediate` for queuing tasks after the current event loop tick. While `setImmediate` and `process.nextTick` have slightly different use cases and behaviors, the process package provides a similar functionality for environments where `setImmediate` is not available. It's more focused on mimicking Node.js environment capabilities in non-Node.js environments.
FAQs
Simple setImmediate shim
The npm package set-immediate-shim receives a total of 1,160,873 weekly downloads. As such, set-immediate-shim popularity was classified as popular.
We found that set-immediate-shim demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.