{"id":24691727,"url":"https://github.com/zengfenfei/delay","last_synced_at":"2025-07-29T23:16:14.966Z","repository":{"id":57211842,"uuid":"83625772","full_name":"zengfenfei/delay","owner":"zengfenfei","description":"The promise API for setTimeout","archived":false,"fork":false,"pushed_at":"2018-05-30T12:44:44.000Z","size":4,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T08:38:08.190Z","etag":null,"topics":["javascript","promise","settimeout","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zengfenfei.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}},"created_at":"2017-03-02T02:38:39.000Z","updated_at":"2025-06-24T21:53:06.000Z","dependencies_parsed_at":"2022-08-30T15:31:40.403Z","dependency_job_id":null,"html_url":"https://github.com/zengfenfei/delay","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zengfenfei/delay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zengfenfei%2Fdelay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zengfenfei%2Fdelay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zengfenfei%2Fdelay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zengfenfei%2Fdelay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zengfenfei","download_url":"https://codeload.github.com/zengfenfei/delay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zengfenfei%2Fdelay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267779083,"owners_count":24143178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["javascript","promise","settimeout","typescript"],"created_at":"2025-01-26T19:18:01.739Z","updated_at":"2025-07-29T23:16:14.944Z","avatar_url":"https://github.com/zengfenfei.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# delay\n\nThe promise API for `setTimeout`. It has the same features with the module [delay](https://github.com/sindresorhus/delay), but all written in typescript.\n\n## Install\n`$ yarn add delay.ts`\n\n## Usage\n\n```javascript\nimport delay, { delayReject, delayThen, delayCatch } from 'delay.ts';\n\ndelay(3 * 1000, 'some value').then(v =\u003e {\n    // Executed in 3 seconds\n    console.log(v);\n});\n\ndelayReject(2 * 1000, 'some error').catch(e =\u003e {\n    // Executed in 2 seconds\n    console.error(e);\n});\n\nPromise.resolve('some value').then(delayThen(1000)).then(v =\u003e {\n    // Executed in a second.\n    // The result of the previous promise is passed through\n    console.log(v);\n});\n\nPromise.reject('some error').catch(delayCatch(1000)).catch(e =\u003e {\n    // Executed in a second.\n    // The error of the previous promise is passed through\n    console.log(e);\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzengfenfei%2Fdelay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzengfenfei%2Fdelay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzengfenfei%2Fdelay/lists"}