{"_id":"get-ready","_rev":"3642848","name":"get-ready","description":"mixin to add one-time ready event callback handler","dist-tags":{"latest":"3.1.0"},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"time":{"modified":"2024-11-11T06:43:51.000Z","created":"2015-09-29T07:58:00.717Z","3.1.0":"2023-10-10T15:57:40.868Z","3.0.0":"2023-06-05T06:04:18.975Z","2.0.1":"2017-02-09T13:37:19.404Z","2.0.0":"2017-02-08T08:41:29.688Z","1.0.0":"2015-09-29T07:58:00.717Z"},"users":{"tiancheng9":true},"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"https://github.com/fengmk2"},"repository":{"type":"git","url":"git://github.com/node-modules/get-ready.git"},"versions":{"3.1.0":{"name":"get-ready","version":"3.1.0","description":"mixin to add one-time ready event callback handler","dependencies":{},"devDependencies":{"@eggjs/tsconfig":"^1.3.3","@types/mocha":"^10.0.2","@types/node":"^20.8.4","egg-bin":"^6.4.1","eslint":"^8.51.0","eslint-config-egg":"^13.0.0","git-contributor":"^2.1.5","tshy":"^1.2.2","tshy-after":"^1.0.0","typescript":"^5.2.2"},"engines":{"node":">= 16.13.0"},"scripts":{"contributor":"git-contributor","lint":"eslint src test --ext ts","test":"npm run lint && egg-bin test","ci":"egg-bin cov && npm run prepublishOnly && npm pack","clean":"tsc -b --clean","prepublishOnly":"tshy && tshy-after"},"repository":{"type":"git","url":"git://github.com/node-modules/get-ready.git"},"keywords":["ready","get-ready","once","event"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"https://github.com/fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/get-ready/issues"},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"type":"module","types":"./dist/commonjs/index.d.ts","_id":"get-ready@3.1.0","gitHead":"63dc788434dd4dff071ba3c4c52eae20c8a48b68","homepage":"https://github.com/node-modules/get-ready#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"shasum":"b514464be5fb235ca3fbce4dace8a95936b3cc53","size":5352,"noattachment":false,"key":"/get-ready/-/get-ready-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-ready/download/get-ready-3.1.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-ready_3.1.0_1696953460610_0.8496362205221635"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-10T15:57:40.868Z","publish_time":1696953460868,"_source_registry_name":"default","_cnpm_publish_time":1696953460868},"3.0.0":{"name":"get-ready","version":"3.0.0","description":"mixin to add one-time ready event callback handler","main":"lib/index.js","types":"lib/index.d.ts","dependencies":{},"devDependencies":{"@eggjs/tsconfig":"^1.3.3","@types/mocha":"^10.0.1","@types/node":"^20.2.5","egg-bin":"^6.4.1","eslint":"^8.42.0","eslint-config-egg":"^12.2.1","typescript":"^5.1.3"},"engines":{"node":">= 16.13.0"},"scripts":{"lint":"eslint .","test":"npm run lint && egg-bin test","ci":"egg-bin cov && npm run tsc","clean":"tsc -b --clean","tsc":"tsc","prepublishOnly":"npm run tsc"},"repository":{"type":"git","url":"git://github.com/node-modules/get-ready.git"},"keywords":["ready","get-ready","once","event"],"author":{"name":"fengmk2","email":"fengmk2@gmail.com","url":"https://github.com/fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/get-ready/issues"},"gitHead":"82c07e5bdc79b0bedc8f9a79de05cb5980ea0f6b","homepage":"https://github.com/node-modules/get-ready#readme","_id":"get-ready@3.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"6d8495bb4f90e6745cce7a20c1d01bb58f7c5087","size":3727,"noattachment":false,"key":"/get-ready/-/get-ready-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-ready/download/get-ready-3.0.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-ready_3.0.0_1685945058815_0.41709897168811194"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-05T06:04:18.975Z","publish_time":1685945058975,"_source_registry_name":"default","_cnpm_publish_time":1685945058975},"2.0.1":{"name":"get-ready","version":"2.0.1","description":"mixin to add one-time ready event callback handler","main":"index.js","files":["index.js"],"dependencies":{"is-type-of":"^1.0.0"},"engines":{"node":">= 4.0.0"},"devDependencies":{"autod":"^2.7.1","egg":"^0.11.0","egg-bin":"^2.0.2","egg-ci":"^1.1.0","eslint":"^3.15.0","eslint-config-egg":"^3.2.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint && egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git://github.com/node-modules/ready.git"},"keywords":["ready","once","event"],"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/ready/issues"},"ci":{"version":"4, 6, 7"},"gitHead":"39471fbb793054f13a27604718ff14c0c99599c3","homepage":"https://github.com/node-modules/ready#readme","_id":"get-ready@2.0.1","_shasum":"a48c418753e39cf4d01f3a420cf1b757ddcc648f","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"a48c418753e39cf4d01f3a420cf1b757ddcc648f","size":3069,"noattachment":false,"key":"/get-ready/-/get-ready-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-ready/download/get-ready-2.0.1.tgz"},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-ready-2.0.1.tgz_1486647439186_0.6103857874404639"},"directories":{},"publish_time":1486647439404,"_cnpm_publish_time":1486647439404,"_hasShrinkwrap":false},"2.0.0":{"name":"get-ready","version":"2.0.0","description":"mixin to add one-time ready event callback handler","main":"index.js","files":["index.js"],"dependencies":{"is-type-of":"^1.0.0"},"engines":{"node":">= 4.0.0"},"devDependencies":{"autod":"^2.7.1","egg":"^0.11.0","egg-bin":"^2.0.2","egg-ci":"^1.1.0","eslint":"^3.15.0","eslint-config-egg":"^3.2.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint && egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git://github.com/node-modules/ready.git"},"keywords":["ready","once","event"],"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/ready/issues"},"ci":{"version":"4, 6, 7"},"gitHead":"f65ca11a589454c4e0d5b03f89a00f10201279b0","homepage":"https://github.com/node-modules/ready#readme","_id":"get-ready@2.0.0","_shasum":"82332f1af687f182c4e9e7663b7ea27a330b1e10","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"82332f1af687f182c4e9e7663b7ea27a330b1e10","size":3007,"noattachment":false,"key":"/get-ready/-/get-ready-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-ready/download/get-ready-2.0.0.tgz"},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-ready-2.0.0.tgz_1486543289411_0.716877901693806"},"directories":{},"publish_time":1486543289688,"_cnpm_publish_time":1486543289688,"_hasShrinkwrap":false},"1.0.0":{"name":"get-ready","version":"1.0.0","description":"mixin to add one-time ready event callback handler","main":"index.js","files":["index.js"],"dependencies":{},"devDependencies":{"eslint":"1","istanbul":"0","mocha":"2","should":"7","thunk-mocha":"0"},"scripts":{"lint":"eslint index.js test","test":"mocha -r thunk-mocha test/*.test.js","test-cov":"istanbul cover node_modules/.bin/_mocha -- -r thunk-mocha test/*.test.js"},"repository":{"type":"git","url":"git://github.com/node-modules/ready.git"},"keywords":["ready","once","event"],"author":{"name":"fengmk2","email":"m@fengmk2.com","url":"http://fengmk2.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/ready/issues"},"gitHead":"f0b30352a084ee65bc44d493ab2e2629a3d8a5d8","homepage":"https://github.com/node-modules/ready#readme","_id":"get-ready@1.0.0","_shasum":"f91817f1e9adecfea13a562adfc8de883ab34782","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"akitasummer","email":""},{"name":"atian25","email":"atian25@qq.com"},{"name":"coolme200","email":""},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eggjs-admin","email":""},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"gxkl","email":""},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"mansonchor.zzw","email":""},{"name":"popomore","email":""},{"name":"wanghx","email":"851094531@qq.com"}],"dist":{"shasum":"f91817f1e9adecfea13a562adfc8de883ab34782","size":2635,"noattachment":false,"key":"/get-ready/-/get-ready-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-ready/download/get-ready-1.0.0.tgz"},"directories":{},"publish_time":1443513480717,"_cnpm_publish_time":1443513480717,"_hasShrinkwrap":false}},"readme":"# get-ready\n\n[![NPM version][npm-image]][npm-url]\n[![CI](https://github.com/node-modules/get-ready/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/get-ready/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/get-ready.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/get-ready\n[codecov-image]: https://codecov.io/github/node-modules/get-ready/coverage.svg?branch=master\n[codecov-url]: https://codecov.io/github/node-modules/get-ready?branch=master\n[download-image]: https://img.shields.io/npm/dm/get-ready.svg?style=flat-square\n[download-url]: https://npmjs.org/package/get-ready\n\n**Fork from [supershabam/ready](https://github.com/supershabam/ready)**\n\none-time ready event object.\n\n## Usage\n\nCreate `ready` event object.\n\n```ts\nimport { Ready } from 'get-ready';\n\nconst obj = new Ready();\n\n// register a callback\nobj.ready(() => console.log('ready'));\n\n// mark ready\nobj.ready(true);\n```\n\n### Register\n\nRegister a callback to the callback stack, it will be called when mark as ready, see example above.\n\nIf the callback is undefined, register will return a promise.\n\n```ts\nobj.ready().then(() => console.log('ready'));\nobj.ready(true);\n```\n\nIf it has been ready, the callback will be called immediately.\n\n```ts\n// already ready\nobj.ready(true);\nobj.ready().then(() => console.log('ready'));\n```\n\n**Warning: the callback is called after nextTick**\n\n### Emit\n\nMark it as ready, you can simply using `.ready(true)`.\n\nYou can also mark it not ready.\n\n```ts\nobj.ready(true);\n// call immediately\nobj.ready(() => console.log('ready'));\n\nobj.ready(false);\nobj.ready(() => throw 'don\\'t run');\n```\n\nWhen exception throws, you can pass an error object, then the callback will receive it as the first argument.\n\n```ts\nobj.ready(err => console.log(err));\nobj.ready(new Error('err'));\n```\n\n## License\n\n[MIT](LICENSE)\n\n<!-- GITCONTRIBUTOR_START -->\n\n## Contributors\n\n|[<img src=\"https://avatars.githubusercontent.com/u/221826?v=4\" width=\"100px;\"/><br/><sub><b>supershabam</b></sub>](https://github.com/supershabam)<br/>|[<img src=\"https://avatars.githubusercontent.com/u/156269?v=4\" width=\"100px;\"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src=\"https://avatars.githubusercontent.com/u/360661?v=4\" width=\"100px;\"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src=\"https://avatars.githubusercontent.com/u/985607?v=4\" width=\"100px;\"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src=\"https://avatars.githubusercontent.com/u/32174276?v=4\" width=\"100px;\"/><br/><sub><b>semantic-release-bot</b></sub>](https://github.com/semantic-release-bot)<br/>|\n| :---: | :---: | :---: | :---: | :---: |\n\nThis project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Jun 05 2023 14:06:50 GMT+0800`.\n\n<!-- GITCONTRIBUTOR_END -->\n","_attachments":{},"homepage":"https://github.com/node-modules/get-ready#readme","bugs":{"url":"https://github.com/node-modules/get-ready/issues"},"license":"MIT"}