{"id":23350859,"url":"https://github.com/e0selmy4v/scpo-proce","last_synced_at":"2025-04-07T18:22:22.430Z","repository":{"id":64979224,"uuid":"580277995","full_name":"E0SelmY4V/scpo-proce","owner":"E0SelmY4V","description":"Make your async programming easier","archived":false,"fork":false,"pushed_at":"2023-04-02T16:30:45.000Z","size":161,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T08:51:32.618Z","etag":null,"topics":["async","callback","es3","from-scpos","ie","ie5","promise","util","utilities","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/scpo-proce","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/E0SelmY4V.png","metadata":{"files":{"readme":"readme-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-20T06:50:49.000Z","updated_at":"2023-03-03T15:38:02.000Z","dependencies_parsed_at":"2023-02-19T01:31:12.969Z","dependency_job_id":null,"html_url":"https://github.com/E0SelmY4V/scpo-proce","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E0SelmY4V%2Fscpo-proce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E0SelmY4V%2Fscpo-proce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E0SelmY4V%2Fscpo-proce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E0SelmY4V%2Fscpo-proce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/E0SelmY4V","download_url":"https://codeload.github.com/E0SelmY4V/scpo-proce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704579,"owners_count":20982299,"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":["async","callback","es3","from-scpos","ie","ie5","promise","util","utilities","utility"],"created_at":"2024-12-21T08:18:59.285Z","updated_at":"2025-04-07T18:22:22.411Z","avatar_url":"https://github.com/E0SelmY4V.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 幻想私社过程类\n\n**简体中文** | [English](readme.md)\n\nscpoProce 全称 Scpos Process，即为幻想私社用以解决困扰社员二百万年的高深异步编程问题而开发的一个跨时代的类：幻想私社过程类。\n本项目灵感来源于 ES6 的`Promise`，可用来减小异步编程带来的复杂性。\n还可配合`await/async`，方便程度更上一层楼。\n\n本项目既可用于 Node.js 的开发，也可用于前端 HTML 页面中的脚本，最高可兼容 IE5（也就是 ES3 ）。\n\n## 引入\n\n- ### NodeJS\n\n  ```javascript\n  const scpoProce = require('scpo-proce');\n  // 或\n  import scpoProce from 'scpo-proce';\n  ```\n\n- ### HTML\n\n  ```html\n  \u003c!--[if IE]\u003e\u003cscript src=\"scpo-proce/es3.js\"\u003e\u003c![endif]--\u003e\n  \u003cscript src=\"scpo-proce/main.js\"\u003e\u003c/script\u003e\n  \u003c!--[if IE]\u003e\u003c/script\u003e\u003c![endif]--\u003e\n  ```\n\n  ```js\n  /// \u003creference path=\"scpo-proce/global.d.ts\" /\u003e\n\n  console.log(scpoProce);\n  ```\n\n## 使用提示\n\n- 本项目有些地方与 ES6 `Promise` 不同。\n  例如 `Promise.then` 是一个微任务，但本项目的 `ScpoProce.then` 不是。\n  有时候放在 `ScpoProce.then` 里的回调会像被同步执行一样。\n\n  ```javascript\n  setTimeout(() =\u003e console.log(1));\n\n  new Promise((resolve) =\u003e {\n    console.log(2);\n    resolve();\n  }).then(() =\u003e {\n    console.log(3);\n  });\n\n  console.log(4);\n\n  // Promise.then 是异步微任务\n  // 控制台输出 2431\n  ```\n\n  ```javascript\n  import scpoProce from 'scpo-proce';\n\n  setTimeout(() =\u003e console.log(1));\n\n  scpoProce((resolve) =\u003e {\n    console.log(2);\n    resolve();\n  }).then(() =\u003e {\n    console.log(3);\n  });\n\n  console.log(4);\n\n  // scpoProce.then 不是微任务\n  // 控制台输出 2341\n  ```\n\n## 使用感想\n\n- 挺方便。\n- 性能貌似比`Promise`高啊，有点神奇，也不知道为什么。\n- 回调抛出错误时，错误追踪里有太多异步类相关的函数，看不清到底哪里出错了。`Promise`就不会出现这个问题，可能因为它不是用 JS 代码实现的吧。\n\n## 其他\n\n- 本项目其实是把 [Scpos Web-Request](https://github.com/E0SelmY4V/scpo-webreq) 的代码加强后制作而成的。\n  如果你是编写 HTML 文档，建议使用对网络请求支持更多的 Scpos Web-Request，其中包括更诡异的参数传递、更全面的的预设配置等。\n\n  （但是已经二百年没更新过了）\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe0selmy4v%2Fscpo-proce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe0selmy4v%2Fscpo-proce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe0selmy4v%2Fscpo-proce/lists"}