{"_id":"@alloc/queue-microtask","_rev":"3-d5a8747f2aa7c221df5c5c95401e594d","name":"@alloc/queue-microtask","dist-tags":{"latest":"1.1.5"},"versions":{"1.1.3":{"name":"@alloc/queue-microtask","description":"fast, tiny `queueMicrotask` shim for modern engines","version":"1.1.3","author":{"name":"Feross Aboukhadijeh","email":"feross@feross.org","url":"https://feross.org"},"bugs":{"url":"https://github.com/feross/queue-microtask/issues"},"dependencies":{},"devDependencies":{"standard":"*","tape":"^4.11.0"},"homepage":"https://github.com/feross/queue-microtask","keywords":["asap","immediate","micro task","microtask","nextTick","process.nextTick","queue micro task","queue microtask","queue-microtask","queueMicrotask","setImmediate","task"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git://github.com/feross/queue-microtask.git"},"scripts":{"test":"standard && tape test/*.js"},"funding":[{"type":"github","url":"https://github.com/sponsors/feross"},{"type":"patreon","url":"https://www.patreon.com/feross"},{"type":"consulting","url":"https://feross.org/support"}],"gitHead":"a27fc6ef19dbdd232c325d2bd8b98c115910bdb1","_id":"@alloc/queue-microtask@1.1.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-X3SSc6GEajXyW66aAfqHbv2ifDyxxlEBvSJD8VBal4jr2Dx1auunh0+CWu8MS0Q2LjRXJTzCEWel5JJGU45B0g==","shasum":"2289b74fb8f7cd688e4f972d6e201b43ce0432f4","tarball":"https://registry.npmjs.org/@alloc/queue-microtask/-/queue-microtask-1.1.3.tgz","fileCount":5,"unpackedSize":8272,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFPWxCRA9TVsSAnZWagAAeBwQAIsbcB4eHEJbr8GcUrta\n/++/AGD9sZT0F91JAy8dL1mDz/myua7W3SmmFOnWuWs7hMjFaVEXpoAOzZUK\noXZniZHpMooVMwQkEoTMFJIviPsMhYh+jOZte2nRjziljZ4IpVyB6zSiNmEb\nWbU4JSDJhRKYtcc4wJzcM3+6QBlvhYbDU30L3ZB1S4FYsqw7Ojiqdlim/2JF\nTMrX3w72Bbcq3UFXsjuFna0Pfd8zrmASV7q67RuKuos1JUpRakx2XVNyj5lE\nuiNnG3yOoAUWSQe+oG5kX4lgVfrihUvjKtoGa6TeuKs1GSFZ5UF5Q+JRIhdK\nnjefOEgG0JLhkYRLfOIrY1WwyKCb+81HrB4QVq2i+0DWZV8X8E044P0nLOe7\nvCtsRUANc5DoIPiqJPMO5ISlDpEl87fpokXy8sBHboydn2xYdjKUDH/LfNLD\n8b51hYvq5JvslxM/2beN0Ydg5WL6ICDEpN6GpNmQjnMPhzQw0wXb0i5+xrDn\n6FO4ltyc2dWywXhd4/YJy8RuEQ/MiOIMjeTbm1UEQROrOtdTajbevCBG+qXd\nKh3RWZgFoXzUFi34n1glGqAhkf/VxeGMVh7jM97EFFmHBxnnx43wndsIfdx4\n6l5NOQtfA1FXEdzVv9xrOLp/m1LPYSovfEWLqs5c4JehNBVauJ6h7ZcNtoE9\nbC9S\r\n=RaVb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClw12hwC5BLPFKqjb6IrQTQB20RPkXKlYe6DgvJiWGVAIhAKw+f1JXeuWcMjm6dIDFMkKg7ODazNgn117ruDmXuIps"}]},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"_npmUser":{"name":"aleclarson","email":"aleclarson@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/queue-microtask_1.1.3_1595209136774_0.6085410451372717"},"_hasShrinkwrap":false},"1.1.4":{"name":"@alloc/queue-microtask","description":"fast, tiny `queueMicrotask` shim for modern engines","version":"1.1.4","author":{"name":"Feross Aboukhadijeh","email":"feross@feross.org","url":"https://feross.org"},"bugs":{"url":"https://github.com/feross/queue-microtask/issues"},"dependencies":{},"devDependencies":{"standard":"*","tape":"^5.0.1"},"homepage":"https://github.com/feross/queue-microtask","keywords":["asap","immediate","micro task","microtask","nextTick","process.nextTick","queue micro task","queue microtask","queue-microtask","queueMicrotask","setImmediate","task"],"license":"MIT","main":"index.js","module":"index.mjs","repository":{"type":"git","url":"git://github.com/feross/queue-microtask.git"},"scripts":{"test":"standard && tape test/*.js"},"funding":[{"type":"github","url":"https://github.com/sponsors/feross"},{"type":"patreon","url":"https://www.patreon.com/feross"},{"type":"consulting","url":"https://feross.org/support"}],"gitHead":"8349832987a56f580d586ce8d9f6e1fcd9c44cca","_id":"@alloc/queue-microtask@1.1.4","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-RQ73vSCZyYWoCORvA5rT/Xg99Zt+MyRhoVhYY2Xm/lXAyx5nsWCPB3xDiS+3fmll3iZ3tDHmtOdiCBX8n2RdVg==","shasum":"89c4f2d1fcc81362ffdeb379fdcf6b2ff006f995","tarball":"https://registry.npmjs.org/@alloc/queue-microtask/-/queue-microtask-1.1.4.tgz","fileCount":6,"unpackedSize":8599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLXb9CRA9TVsSAnZWagAAuogP/i57JNChv2k0iOlc3egh\nLuo//7sBopRWG/hZqWyjEVztTacrp7a7Vj0v6ks31UdxmvpPkwBoWoctTGZb\nvY5jHPyW66yake75V9AQg6+jgx75FS1hjNOYBBkOH7FfnibR9rt1EKDrYrsv\n0o67Paw0dwL2z7VCWNXR3vfH4ASi0PGshEm0CkONafvVPLfmb8CF7Xu5bCpP\nMNMIgpajTOCZVLRdSEGOh4HxWPmSazyDH4anFrcc8PHNCeVRXxq/j4JcqQZN\n6FH7mAT2wdUoCvtBLXGe7xk/TkkfIBM6DJINalTPPVCV8aEYLvcnhY2qxgzz\ngZpKrrvjmd+1T20Nfbx6mRyfGx2o6kjoGfr06CTIHq0Oi/vLxU/bbBbSbNk8\n6Xygo66ZSmNizZQi848MS3BrjVPGjUt7boejN9p6/X84gwoz3e4GFVy8AVBk\nitb6jI1SKKibKlIV1xP/Np4sGECSs+EuZvee+kmGkEAHaoYXMFNnAlL/u0n1\nIY6W/fEKda/XVb1oqJha0Lt75wkXTl8fvlwgdiqegFEuDaHwK2GIDlpeGTCa\nPx5L7TDnzRkrE1hRq1qyIuKwuyVY2+2ji62ocWMrxrr4hw9A2qd6KYvxwCTi\nKWQS4CEuxQjrEqs6tGFarqLB+I4q7kX2ns2e/U+B2h4kRCJxqDPnxXmxHU4E\neTR/\r\n=6JD5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/gPNQdofvFQ6WfoI2+NETwtYU83OhFlauNJL3/gtwOAiEA7DInVEQuJnPK9yqa5BlRGcYsf7aUqI1geZOTPjK1WvU="}]},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"_npmUser":{"name":"aleclarson","email":"aleclarson@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/queue-microtask_1.1.4_1596815101302_0.9195903090839062"},"_hasShrinkwrap":false},"1.1.5":{"name":"@alloc/queue-microtask","description":"fast, tiny `queueMicrotask` shim for modern engines","version":"1.1.5","author":{"name":"Feross Aboukhadijeh","email":"feross@feross.org","url":"https://feross.org"},"bugs":{"url":"https://github.com/feross/queue-microtask/issues"},"dependencies":{},"devDependencies":{"standard":"*","tape":"^5.0.1"},"homepage":"https://github.com/feross/queue-microtask","keywords":["asap","immediate","micro task","microtask","nextTick","process.nextTick","queue micro task","queue microtask","queue-microtask","queueMicrotask","setImmediate","task"],"license":"MIT","main":"index.js","module":"index.mjs","repository":{"type":"git","url":"git://github.com/feross/queue-microtask.git"},"scripts":{"test":"standard && tape test/*.js"},"funding":[{"type":"github","url":"https://github.com/sponsors/feross"},{"type":"patreon","url":"https://www.patreon.com/feross"},{"type":"consulting","url":"https://feross.org/support"}],"gitHead":"90f890534be8b795c60e1cdf78600b2803a6ee74","_id":"@alloc/queue-microtask@1.1.5","_nodeVersion":"14.13.1","_npmVersion":"7.10.0","dist":{"integrity":"sha512-+11mLrN7Xu9a9uU0fdsZICVDi8vhxtqxaqX+nPyPXmrDJBPUqKc34aJak8KEdjkhhGFTuqs8ZiiuwP423Do14w==","shasum":"e9797e36af248384557383b00e8594ea8b7d85a7","tarball":"https://registry.npmjs.org/@alloc/queue-microtask/-/queue-microtask-1.1.5.tgz","fileCount":6,"unpackedSize":8609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnDTiCRA9TVsSAnZWagAAzhkP/0rOIkL18Sa3LJk+JJnz\ndtdGuDD9l/jO91HpMdsIaRuV9M4oe37KH27dlQWyduxLU9NhcysNblS+AZSp\n9jllZ/lF7AksUZmBF1X7LmkFsb6JESUnqxicU4UnczsZoDZ24YRWOkDxSm65\ngVt6Rvih1F8uCuU5MfnSMKjEonbElSc61XwI49F2SVCeZkaV8t68U7hJDiGN\nRYHh9TouEQYLUDVtvDV8CjHl0DCMHeQs8k1CD+ueMoclMHVs71o5cCmsX8Ap\nHFOVJ206Uo2ag/hJP6UqDSujyUM/p7N3Oe6hcsv2mQmuSEbJKOGSCQ/qqCkg\n1SCQjhH6c+KuKA9V6D7pPfm/jx11CLCrcFfbK1zFwhKOLxu6WLAw+Tw5AN4E\nA/8ANScp3hpDxBvWrICbhqIeDKS564rdkCf9xhuPYXg/37r1H28d7zARhW8r\ni4USBGk92upvy2fHR4sace8n2N/OY/Q8yQuNCpiTuNUUjvok00Wv9wzgx7YW\n6MhyPQ/O+g86lh0YPpy0H00LlTtdaef2l/nhoCW4u2JhrMKTvUVgfshts8Z/\nIxeUx7TKwIatK61xRREgy7ZtBdxoKc4JqCveG4QOFBLoFikPFfq80T39Xww3\nXJ0tJ3g++BVzfth3KWoDahUAanFeMir/6EjVVzcSSfqXEEMCzz7cfsWHv3k1\nDfxO\r\n=4kwy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKoepqr1Q71tZs+kgvzIujmmbay5zGOSmrXo+C1XdSoAIgIyiV7Wf5lhADH14nxOcVruuGpMoFKQy5w+HqkvvG8DU="}]},"_npmUser":{"name":"aleclarson","email":"aleclarson@protonmail.com"},"directories":{},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/queue-microtask_1.1.5_1620849889550_0.716916725549932"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-20T01:38:56.588Z","1.1.3":"2020-07-20T01:38:56.879Z","modified":"2022-04-04T13:33:38.218Z","1.1.4":"2020-08-07T15:45:01.445Z","1.1.5":"2021-05-12T20:04:49.902Z"},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"description":"fast, tiny `queueMicrotask` shim for modern engines","homepage":"https://github.com/feross/queue-microtask","keywords":["asap","immediate","micro task","microtask","nextTick","process.nextTick","queue micro task","queue microtask","queue-microtask","queueMicrotask","setImmediate","task"],"repository":{"type":"git","url":"git://github.com/feross/queue-microtask.git"},"author":{"name":"Feross Aboukhadijeh","email":"feross@feross.org","url":"https://feross.org"},"bugs":{"url":"https://github.com/feross/queue-microtask/issues"},"license":"MIT","readme":"# queue-microtask [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[travis-image]: https://img.shields.io/travis/feross/queue-microtask/master.svg\n[travis-url]: https://travis-ci.org/feross/queue-microtask\n[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg\n[npm-url]: https://npmjs.org/package/queue-microtask\n[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg\n[downloads-url]: https://npmjs.org/package/queue-microtask\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines\n\n- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all JS engines.\n- No dependencies. Less than 10 lines. No shims or complicated fallbacks.\n- Optimal performance in all modern environments.\n  - Use `queueMicrotask` in modern environments (optimal)\n  - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (optimal)\n  - Fallback to `setTimeout` in JS environments without `Promise` (slow)\n\n## install\n\n```\nnpm install queue-microtask\n```\n\n## usage\n\n```js\nconst queueMicrotask = require('queue-microtask')\n\nqueueMicrotask(() => { /* this will run soon */ })\n```\n\n## What is `queueMicrotask` and why would one use it?\n\nThe `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop.\n\nA microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop.\n\nThe code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node.\n\nUsing microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context.\n\nSee the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information.\n\n## Who is this package for?\n\nThis package allows you to use `queueMicrotask` safely in all JS engines. Use it if you prioritize small JS bundle size over optimal performance in old browsers.\n\n## Why not use `process.nextTick`?\n\nIn Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations.\n\nIf you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package.\n\n## Why not use `setTimeout(fn, 0)`?\n\nThis approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program.\n\n## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)?\n\nThese packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package.\n\nThis package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically.\n\nNote: This package does not have proper microtask support in old browsers. Instead, old browsers fallback to `setTimeout`. This will be slower, but it allows us to avoid including a complicated solution.\n\nSince the `queueMicrotask` API is supported in Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get the optimal experience**. Any JS environment with `Promise`, which is almost all of them, also get the optimal experience. If you need optimal performance in old browsers, use one of the alternative packages.\n\n## What is a shim?\n\n> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing))\n\nThis package could also be described as a \"ponyfill\".\n\n> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills)\n\n## API\n\n### `queueMicrotask(fn)`\n\nThe `queueMicrotask()` method queues a microtask.\n\nThe `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop.\n\n## license\n\nMIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org).\n","readmeFilename":"README.md"}