{"id":18797818,"url":"https://github.com/jzplp/promisejz","last_synced_at":"2026-01-01T18:30:13.642Z","repository":{"id":197461965,"uuid":"698698535","full_name":"jzplp/PromiseJz","owner":"jzplp","description":"符合Promises/A+规范的Javascript异步编程Promise的完整实现，并且提供了与ECMAScript同样的实用函数。","archived":false,"fork":false,"pushed_at":"2023-10-03T15:11:53.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-29T18:14:35.957Z","etag":null,"topics":["ecmascript","javascript","promise"],"latest_commit_sha":null,"homepage":"https://jzplp.github.io/2023/promise-intro.html","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/jzplp.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}},"created_at":"2023-09-30T17:30:25.000Z","updated_at":"2024-04-07T05:17:10.000Z","dependencies_parsed_at":"2023-10-02T20:32:21.993Z","dependency_job_id":null,"html_url":"https://github.com/jzplp/PromiseJz","commit_stats":null,"previous_names":["jzplp/promise-jz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzplp%2FPromiseJz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzplp%2FPromiseJz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzplp%2FPromiseJz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzplp%2FPromiseJz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jzplp","download_url":"https://codeload.github.com/jzplp/PromiseJz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727046,"owners_count":19687098,"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","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":["ecmascript","javascript","promise"],"created_at":"2024-11-07T22:09:41.338Z","updated_at":"2026-01-01T18:30:13.591Z","avatar_url":"https://github.com/jzplp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PromiseJz\n符合Promises/A+规范的Javascript异步编程Promise的完整实现，并且提供了与ECMAScript同样的实用函数。\n\n## 实现说明\n这篇文章详细描述了一步一步从零开始实现Promise完整过程，可进行参考。\n\n- 超详细！手把手带你实现一个完整的Promise\\\n  https://jzplp.github.io/2023/promise-intro.html\n\n## 工程结构说明\nsrc中的不同文件夹按照实现说明的顺序组织，包含了不同阶段Promise的实现代码。其中index.js是Promise的实现代码，其中实现的类名叫做`PromiseJz`。test.js是我们的自测代码。\n\n- src/step1/\\\n  第一部分 创建Promise类和构造函数\n- src/step2/\\\n  第二部分 初步实现then方法\n- src/step3/\\\n  第三部分 完善then方法\n- src/step4\\\n  第四部分 更多异常处理\n- src/APlus/\\\n  第五部分(A+规范版) **通过Promises/A+规范测试**\n- src/step6/\\\n  第六部分 静态resolve/reject方法\n- src/step7/\\\n  第七部分 catch/finally方法\n- src/step8/\\\n  第八部分 接收数组的静态方法\n- src/final/\\\n  最终完成版 **通过Promises/A+规范测试**\n\n## 开发说明\n```sh\n# 安装依赖\npnpm install\n# 使用test.js对第n部分进行测试\npnpm test:step1\npnpm test:step2\npnpm test:step3\npnpm test:step4\npnpm test:step6\npnpm test:step7\npnpm test:step8\n# 使用Promises/A+规范测试工具测试 第五部分(A+规范版)代码\npnpm test:APlus\n# 使用Promises/A+规范测试工具测试 最终完成版代码\npnpm test:APlusFinal\n```\n\n## 功能说明\n不同版本实现的对外可调用的方法。\n\n### 第五部分(A+规范版)\n- `PromiseJz.prototype.then()`\n- `PromiseJz.deferred()` 测试用\n\n### 最终完成版\n- `Promise.prototype.then()`\n- `Promise.prototype.catch()`\n- `Promise.prototype.finally()`\n- `Promise.resolve()`\n- `Promise.reject()`\n- `Promise.all()`\n- `Promise.race()`\n- `Promise.allSettled()`\n- `Promise.any()`\n- `PromiseJz.deferred()` 测试用\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzplp%2Fpromisejz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjzplp%2Fpromisejz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzplp%2Fpromisejz/lists"}