{"_id":"set-immediate-shim","_rev":"1509178","name":"set-immediate-shim","description":"Simple setImmediate shim","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2026-10-02T07:54:31.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":{"integrity":"sha512-ITNCbwiVRRYAUndnX15fevxRYurDFxDnBA6//Q9Ql7yabS9vCwwLrEhIy1ISaZRYPwgkfVDAdyUUBgieKI8JAQ==","shasum":"7745d43b511abd667228188cb38954959cafdd66","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-4.0.0.tgz","fileCount":5,"unpackedSize":4676,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICKrrU5MRYp9X5JYUgkeOF3Oc9Ge0YcK+SH3AR7ni0eeAiEA1mHhSFeE1RzD4Ugd27WaM2tRKPemZa360j6PLSBKlk4="}],"size":2205,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/set-immediate-shim_4.0.0_1757753193306_0.9383099845172345"},"_hasShrinkwrap":false,"publish_time":1757753193489,"_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":{"integrity":"sha512-YFBnuyT0Yab+05Mvi04jrganY5+k/s6RqCu1bcAbzNZ1zLBtd31OPLstwRLWn1JyiJ8KKnpIIPQGJgx0gGjEaQ==","shasum":"13a89d3de01765e1f24505e47fd0ea2e680ab87f","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-3.1.0.tgz","fileCount":5,"unpackedSize":2960,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxC6h83Xnkm1G9CzWbXpdLqoDOt1Bk6LmaS3iNhvIgvAIhAOPeHtfVKjszaCraGShY9zAab5jSGzzNupLp9yLAB7iQ"}],"size":1712,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-3.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-immediate-shim_3.1.0_1710221199555_0.023811896836675617"},"_hasShrinkwrap":false,"publish_time":1710221199706,"_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":{"integrity":"sha512-X4vkRp6bmUG89tVQg+ns+gz22EZT6NfUSWWL+AP4Vy1MQ0NpCNToDc6XnL+oIv7meqNjbw8ewH4zSLcRhjlAuA==","shasum":"ca868b7c86c01154a56f2c074ac783ee7b9e14eb","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-3.0.0.tgz","fileCount":4,"unpackedSize":2675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUpdPsg7fr7kL6Kz25VBN7QRtTsscP6WnBv2f/rSzaoAiB34r6OWWoIThZAvorZ7hywVJqes4SuOW/P0Aps/XrMFg=="}],"size":1559,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-immediate-shim_3.0.0_1710219898130_0.27766618525501485"},"_hasShrinkwrap":false,"publish_time":1710219898287,"_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":{"integrity":"sha512-a2GXgsl1Wu9qulGQeY3c3KRVgcmxeaOI15xenfNJ1eBX6BBavWCNXdX9gcvQJAogSROaU3o5DTQUVcRdzbIOfA==","shasum":"5bf3ecf5d0d6eda9a335dbb5bfd0733f3e149d8d","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-2.0.0.tgz","fileCount":4,"unpackedSize":2561,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7z3p9tHmN79G4/PBBlJyfc4WmaWe86YwXaKNPu1MiswIgT6MTnikLpDepqhMqQt1kiX8bPRlyXsP93ouCB/xa2Kw="}],"size":1526,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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":"sindresorhus@gmail.com"}],"dist":{"shasum":"4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz","integrity":"sha512-Li5AOqrZWCVA2n5kryzEmqai6bKSIvpz5oUJHPVj6+dsbD3X1ixtsY5tEnsaNpH3pFAHmG8eIHUrtEtohrg+UQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEO1c831HnX3lzb/KjR3YJPkstwbZOKmPrbIomCmJi9wIhANKJ4i6ZgolqSKsFay52SiUFOsS9MxGJyYg2W7sOVb35"}],"size":821,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz"},"directories":{},"publish_time":1426146360857,"_cnpm_publish_time":1426146360857},"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":"sindresorhus@gmail.com"}],"dist":{"shasum":"e23b45a33244f6f2dcd90359bc38bdbf048de152","tarball":"http://registry-npm.ywwl.com/set-immediate-shim/download/set-immediate-shim-1.0.0.tgz","integrity":"sha512-7pk+WycSLRgX/Rf5+SI0cmq9aeb+1LIHzI50tkgNJocSRpMPcWOkPmw40mFYQNUbUJMuAKa5eWHw/bXmp2/AAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuzq1SAcK8HP1Zb5Rmt2T1dks2X2aRXKlEpZs3fta3dAiBvJTbNqPM+0pv6xpJMvMWChe23w0P7Bt907NMHo2ZZmQ=="}],"size":1473,"noattachment":false,"key":"/set-immediate-shim/-/set-immediate-shim-1.0.0.tgz"},"directories":{},"publish_time":1419846099091,"_cnpm_publish_time":1419846099091}},"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"}