{"_id":"set-immediate-shim","_rev":"4605757","name":"set-immediate-shim","description":"Simple setImmediate shim","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-10T17:37:16.000Z","created":"2014-12-29T09:41:39.091Z","4.0.0":"2025-09-13T08:46:33.489Z","3.1.0":"2024-03-12T05:26:39.706Z","3.0.0":"2024-03-12T05:04:58.287Z","2.0.0":"2018-03-25T15:48:50.775Z","1.0.1":"2015-03-12T07:46:00.857Z","1.0.0":"2014-12-29T09:41:39.091Z"},"users":{"koulmomo":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/set-immediate-shim.git"},"versions":{"4.0.0":{"name":"set-immediate-shim","version":"4.0.0","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/set-immediate-shim.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["setimmediate","immediate","settimeout","timeout","shim","polyfill","ponyfill","messagechannel"],"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"_id":"set-immediate-shim@4.0.0","gitHead":"0446280ceb6afca19b1ae2cc3049d2be32907584","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"7745d43b511abd667228188cb38954959cafdd66","size":2205,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/set-immediate-shim_4.0.0_1757753193306_0.9383099845172345"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-13T08:46:33.489Z","publish_time":1757753193489,"_source_registry_name":"default","_cnpm_publish_time":1757753193489},"3.1.0":{"name":"set-immediate-shim","version":"3.1.0","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/set-immediate-shim.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["setimmediate","immediate","settimeout","timeout","shim","polyfill","ponyfill"],"devDependencies":{"ava":"^6.1.2","xo":"^0.58.0"},"types":"./index.d.ts","gitHead":"ff94a9efdfaf4adac9b9e1e0420c0faac8d38d52","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim#readme","_id":"set-immediate-shim@3.1.0","_nodeVersion":"20.11.1","_npmVersion":"9.2.0","dist":{"shasum":"13a89d3de01765e1f24505e47fd0ea2e680ab87f","size":1712,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-3.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-immediate-shim_3.1.0_1710221199555_0.023811896836675617"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-12T05:26:39.706Z","publish_time":1710221199706,"_source_registry_name":"default","_cnpm_publish_time":1710221199706},"3.0.0":{"name":"set-immediate-shim","version":"3.0.0","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/set-immediate-shim.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["setimmediate","immediate","settimeout","timeout","shim","polyfill","ponyfill"],"devDependencies":{"ava":"^6.1.2","xo":"^0.58.0"},"gitHead":"377bbef6b4df28e9766d019d7707d6cc43083a7e","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim#readme","_id":"set-immediate-shim@3.0.0","_nodeVersion":"18.19.0","_npmVersion":"9.2.0","dist":{"shasum":"ca868b7c86c01154a56f2c074ac783ee7b9e14eb","size":1559,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-immediate-shim_3.0.0_1710219898130_0.27766618525501485"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-12T05:04:58.287Z","publish_time":1710219898287,"_source_registry_name":"default","_cnpm_publish_time":1710219898287},"2.0.0":{"name":"set-immediate-shim","version":"2.0.0","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/set-immediate-shim.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["setimmediate","immediate","settimeout","timeout","shim","polyfill","ponyfill"],"devDependencies":{"ava":"*","import-fresh":"^2.0.0","xo":"*"},"gitHead":"4e67c0d38a2a3239c523a30776bc55186d51d365","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim#readme","_id":"set-immediate-shim@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5bf3ecf5d0d6eda9a335dbb5bfd0733f3e149d8d","size":1526,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-immediate-shim_2.0.0_1521992930693_0.12283900291391592"},"_hasShrinkwrap":false,"publish_time":1521992930775,"_cnpm_publish_time":1521992930775},"1.0.1":{"name":"set-immediate-shim","version":"1.0.1","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/set-immediate-shim"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["setImmediate","immediate","setTimeout","timeout","shim","polyfill","ponyfill"],"devDependencies":{"ava":"0.0.4","require-uncached":"^1.0.2"},"gitHead":"4c50df7ade5a368e106fee82351ee0a378c990f7","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim","_id":"set-immediate-shim@1.0.1","_shasum":"4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61","size":821,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz"},"directories":{},"publish_time":1426146360857,"_cnpm_publish_time":1426146360857,"_hasShrinkwrap":false},"1.0.0":{"name":"set-immediate-shim","version":"1.0.0","description":"Simple setImmediate shim","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/set-immediate-shim"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["setImmediate","immediate","setTimeout","timeout","shim","polyfill","ponyfill"],"devDependencies":{"ava":"0.0.4","require-uncached":"^1.0.2"},"gitHead":"29ac611e181046f2cf8b61ed5d038c64733a1cbc","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"homepage":"https://github.com/sindresorhus/set-immediate-shim","_id":"set-immediate-shim@1.0.0","_shasum":"e23b45a33244f6f2dcd90359bc38bdbf048de152","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"e23b45a33244f6f2dcd90359bc38bdbf048de152","size":1473,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-immediate-shim/download/set-immediate-shim-1.0.0.tgz"},"directories":{},"publish_time":1419846099091,"_cnpm_publish_time":1419846099091,"_hasShrinkwrap":false}},"readme":"# set-immediate-shim\n\n> Simple [`setImmediate`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate) [ponyfill](https://ponyfill.com)\n\nThe shim uses the native `setImmediate` when available (Node.js), falls back to [`MessageChannel`](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel) for better performance in environments that support it (modern browsers, Deno), and uses `setTimeout` with zero delay as a last resort.\n\n## Install\n\n```sh\nnpm install set-immediate-shim\n```\n\n## Usage\n\n```js\nimport setImmediateShim from 'set-immediate-shim';\n\nsetImmediateShim(() => {\n\tconsole.log('2');\n});\n\nconsole.log('1');\n\n//=> 1\n//=> 2\n```\n\n## Related\n\n- [p-immediate](https://github.com/sindresorhus/p-immediate) - Returns a promise resolved in the next event loop - think `setImmediate()`\n","_attachments":{},"homepage":"https://github.com/sindresorhus/set-immediate-shim#readme","bugs":{"url":"https://github.com/sindresorhus/set-immediate-shim/issues"},"license":"MIT"}