{"id":20927341,"url":"https://github.com/yejiayu/wait","last_synced_at":"2026-04-26T19:32:16.457Z","repository":{"id":128729186,"uuid":"85922885","full_name":"yejiayu/wait","owner":"yejiayu","description":"wait event","archived":false,"fork":false,"pushed_at":"2017-03-30T08:39:50.000Z","size":4198,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T08:34:26.406Z","etag":null,"topics":["event","nodejs","wait"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yejiayu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-23T08:05:17.000Z","updated_at":"2017-05-05T14:43:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"676cdd99-5dd9-46a4-8ff2-c4539cc9e728","html_url":"https://github.com/yejiayu/wait","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"d290e4ca3ccf04f1407852e45992fc6db2a1f96c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yejiayu/wait","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yejiayu%2Fwait","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yejiayu%2Fwait/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yejiayu%2Fwait/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yejiayu%2Fwait/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yejiayu","download_url":"https://codeload.github.com/yejiayu/wait/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yejiayu%2Fwait/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32310804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["event","nodejs","wait"],"created_at":"2024-11-18T20:47:51.105Z","updated_at":"2026-04-26T19:32:16.440Z","avatar_url":"https://github.com/yejiayu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wait-event\n\u003e wait event\n\n## Install\n```js\n$ npm i wait-event --save\n```\n\n## Usage\n```js\nconst wait = require('wait-event');\nconst { EventEmitter } = require('events');\nconst event = new EventEmitter()\n\nsetTimeout(() =\u003e {\n  event.emit('ready', 'ready')\n}, 4000)\n\nsetTimeout(() =\u003e {\n  event.emit('timeout')\n}, 6000)\n\nasync () =\u003e {\n  const result = await wait(event, 'ready')\n\n  try {\n    await wait(event, 'timeout', 5000)\n  } catch (e) {\n    console.log(e.name); // TimeoutError\n  }\n\n  // always.....\n  await wait(event, 'always-wait')\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyejiayu%2Fwait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyejiayu%2Fwait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyejiayu%2Fwait/lists"}