{"id":19136935,"url":"https://github.com/singcl/thunk-run","last_synced_at":"2025-07-20T20:05:49.086Z","repository":{"id":57160447,"uuid":"131875571","full_name":"singcl/thunk-run","owner":"singcl","description":"🐔  A counterfeit simple basic co \u0026 comprehension of thunk function and function* in javascript.  ","archived":false,"fork":false,"pushed_at":"2018-05-15T08:08:28.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T01:52:36.785Z","etag":null,"topics":["co","generator","promisify","promsie","runner","thunk","thunkify"],"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/singcl.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":"2018-05-02T16:09:12.000Z","updated_at":"2018-05-15T08:08:22.000Z","dependencies_parsed_at":"2022-09-09T07:31:06.800Z","dependency_job_id":null,"html_url":"https://github.com/singcl/thunk-run","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/singcl/thunk-run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singcl%2Fthunk-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singcl%2Fthunk-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singcl%2Fthunk-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singcl%2Fthunk-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/singcl","download_url":"https://codeload.github.com/singcl/thunk-run/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singcl%2Fthunk-run/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266189677,"owners_count":23890065,"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":["co","generator","promisify","promsie","runner","thunk","thunkify"],"created_at":"2024-11-09T06:35:54.970Z","updated_at":"2025-07-20T20:05:49.066Z","avatar_url":"https://github.com/singcl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Thunkify Runner \u0026 Promisify Runner.\n\n[![npm (scoped)](https://img.shields.io/npm/v/@singcl/thunk-run.svg?style=flat-square)](https://www.npmjs.com/package/@singcl/thunk-run)\n![David](https://img.shields.io/david/dev/singcl/thunk-run.svg?style=flat-square)\n![David](https://img.shields.io/david/singcl/thunk-run.svg?style=flat-square)\n[![npm](https://img.shields.io/npm/dm/@singcl/thunk-run.svg?style=flat-square)](https://www.npmjs.com/package/@singcl/thunk-run)\n![Github file size](https://img.shields.io/github/size/singcl/thunk-run/dist/bundle.min.js.svg?style=flat-square)\n\n### Usage\n\n#### `await` along with Thunkify function.\n```js\nvar fs = require(\"fs\");\nvar path = require(\"path\");\n\nvar thunkify = require(\"@singcl/thunk-run\").thunkify;\nvar thunkifyRun = require(\"@singcl/thunk-run\").thunkifyRun;\n\nvar reaFileThunkify = thunkify(fs.readFile);\nvar filePath = path.resolve(__dirname, \"../package.json\");\n\n// Generator Thunk自动执行器单独为一个thunkifyRun 模块\n\nfunction* gen() {\n    try {\n        var r1 = yield reaFileThunkify(filePath, \"utf8\");\n        console.log(r1);\n        var r2 = yield reaFileThunkify(filePath, \"utf8\");\n        console.log(r2);\n    } catch (error) {\n        console.log(\"Generator内捕获错误：\", error);\n    }\n}\n\nthunkifyRun(gen);\n```\n\n#### `await` along with Promisify function.\n```js\nvar fs = require(\"fs\");\nvar path = require(\"path\");\n\nvar promisify = require(\"@singcl/thunk-run\").promisify;\nvar promisifyRun = require(\"@singcl/thunk-run\").promisifyRun;\n\nvar reaFilePromisify = promisify(fs.readFile);\nvar filePath = path.resolve(__dirname, \"../example/test.txt\");\n\n// Generator Promise 自动执行器单独为一个 promisifyRun 模块\n\nfunction* gen() {\n    try {\n        var r1 = yield reaFilePromisify(filePath, \"utf8\");\n        console.log(r1);\n        var r2 = yield reaFilePromisify(filePath, \"utf8\");\n        console.log(r2);\n    } catch (error) {\n        console.log(\"Generator内捕获错误：\", error);\n    }\n}\n\npromisifyRun(gen);\n```\n\n### UMD\n在dist目录下已经构建好了`UMD`包可以直接使用。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingcl%2Fthunk-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsingcl%2Fthunk-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingcl%2Fthunk-run/lists"}