{"_id":"yoctodelay","_rev":"537347","name":"yoctodelay","description":"Delay a promise a specified amount of time","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-08-14T20:40:46.000Z","created":"2017-10-22T11:24:42.898Z","2.0.0":"2021-08-14T20:38:33.879Z","1.2.0":"2021-02-08T07:40:25.307Z","1.1.0":"2017-10-23T11:43:23.939Z","1.0.0":"2017-10-22T11:24:42.898Z"},"users":{"seangenabe":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctodelay.git"},"versions":{"2.0.0":{"name":"yoctodelay","version":"2.0.0","description":"Delay a promise a specified amount of time","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctodelay.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","resolve","delay","defer","wait","stall","timeout","settimeout","event","loop","next","tick","delay","async","await","promises","bluebird"],"devDependencies":{"ava":"^3.15.0","in-range":"^3.0.0","time-span":"^5.0.0","tsd":"^0.17.0","xo":"^0.44.0"},"xo":{"rules":{"eol-last":"off"},"ignores":["index.js"]},"gitHead":"736bd0779546659b3c933542e43c31d1bfde53a2","bugs":{"url":"https://github.com/sindresorhus/yoctodelay/issues"},"homepage":"https://github.com/sindresorhus/yoctodelay#readme","_id":"yoctodelay@2.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"764574818d7fd16c14b6cea7b5dbb52d6f22cdca","size":2034,"noattachment":false,"key":"/yoctodelay/-/yoctodelay-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/yoctodelay/download/yoctodelay-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoctodelay_2.0.0_1628973513717_0.5061186759183529"},"_hasShrinkwrap":false,"publish_time":1628973513879,"_cnpm_publish_time":1628973513879},"1.2.0":{"name":"yoctodelay","version":"1.2.0","description":"Delay a promise a specified amount of time","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctodelay.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","resolve","delay","defer","wait","stall","timeout","settimeout","event","loop","next","tick","delay","async","await","promises","bluebird"],"devDependencies":{"ava":"^2.4.0","in-range":"^1.0.0","time-span":"^2.0.0","tsd":"^0.14.0","xo":"^0.24.0"},"xo":{"rules":{"eol-last":0},"ignores":["index.js"]},"gitHead":"4ae31dde3a7431e377e3268e457687ea74bb0c40","bugs":{"url":"https://github.com/sindresorhus/yoctodelay/issues"},"homepage":"https://github.com/sindresorhus/yoctodelay#readme","_id":"yoctodelay@1.2.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0d020c8bcec22989369db31e5d352acc6a13eda8","size":1948,"noattachment":false,"key":"/yoctodelay/-/yoctodelay-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/yoctodelay/download/yoctodelay-1.2.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoctodelay_1.2.0_1612770025143_0.21498271718056494"},"_hasShrinkwrap":false,"publish_time":1612770025307,"_cnpm_publish_time":1612770025307},"1.1.0":{"name":"yoctodelay","version":"1.1.0","description":"Delay a promise a specified amount of time","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctodelay.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","resolve","delay","defer","wait","stall","timeout","settimeout","event","loop","next","tick","delay","async","await","promises","bluebird"],"devDependencies":{"ava":"*","in-range":"^1.0.0","time-span":"^2.0.0","xo":"*"},"xo":{"rules":{"eol-last":0},"ignores":["index.js"]},"gitHead":"ad7aef8e570d3217e9845419575bff87122de1ca","bugs":{"url":"https://github.com/sindresorhus/yoctodelay/issues"},"homepage":"https://github.com/sindresorhus/yoctodelay#readme","_id":"yoctodelay@1.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4820ab055bb044a582e92d01701ada043f427132","size":1894,"noattachment":false,"key":"/yoctodelay/-/yoctodelay-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/yoctodelay/download/yoctodelay-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoctodelay-1.1.0.tgz_1508759003810_0.8754480232018977"},"directories":{},"publish_time":1508759003939,"_hasShrinkwrap":false,"_cnpm_publish_time":1508759003939},"1.0.0":{"name":"yoctodelay","version":"1.0.0","description":"Delay a promise a specified amount of time","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctodelay.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","resolve","delay","defer","wait","stall","timeout","settimeout","event","loop","next","tick","delay","async","await","promises","bluebird"],"devDependencies":{"ava":"*","in-range":"^1.0.0","time-span":"^2.0.0","xo":"*"},"xo":{"ignores":["index.js"]},"gitHead":"f640eeb5f440131bb249eea8bf34f6f3d1fd76b8","bugs":{"url":"https://github.com/sindresorhus/yoctodelay/issues"},"homepage":"https://github.com/sindresorhus/yoctodelay#readme","_id":"yoctodelay@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"332610846096a868a6adfe05171cfab3fa57815a","size":1878,"noattachment":false,"key":"/yoctodelay/-/yoctodelay-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/yoctodelay/download/yoctodelay-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoctodelay-1.0.0.tgz_1508671482798_0.9338902852032334"},"directories":{},"publish_time":1508671482898,"_hasShrinkwrap":false,"_cnpm_publish_time":1508671482898}},"readme":"# yoctodelay\n\n> Delay a promise a specified amount of time\n\nIt's less than half the size of the [`nanodelay`](https://github.com/ai/nanodelay) module.\n\n**Note:** If you target Node.js 16 or later, you can use the built-in functionality instead:\n\n```js\nimport {setTimeout as delay} from 'node:timers/promises';\n\nawait delay(100);\n```\n\n## Install\n\n```\n$ npm install yoctodelay\n```\n\n## Usage\n\n```js\nimport delay from 'yoctodelay';\n\nfoo();\n\nawait delay(100);\n\n// Executed 100 milliseconds later\nbar();\n```\n\n## API\n\n### delay(milliseconds)\n\nDelay the promise and then resolve.\n\n#### milliseconds\n\nType: `number`\n\nThe duration to delay the promise.\n\n## FAQ\n\n### What is yocto?\n\n[It's the smallest official unit prefix in the metric system.](https://en.wikipedia.org/wiki/Yocto-) Much smaller than nano.\n\n### Is this a joke?\n\nPartly. The `nanodelay` module was created only because the `delay` module is a tiny bit larger. Well, this module is a tiny bit smaller than the `nanodelay` module. Comparing size at the byte level is super silly. It doesn't matter unless the difference is more than many kilobytes. This is still a fully working module though. Go ahead and use it.\n\n## Related\n\n- [delay](https://github.com/sindresorhus/delay) - Similar to this module but with more features\n- [More…](https://github.com/sindresorhus/promise-fun)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/yoctodelay#readme","bugs":{"url":"https://github.com/sindresorhus/yoctodelay/issues"},"license":"MIT"}