{"id":35862594,"url":"https://github.com/fixjs/awaitify","last_synced_at":"2026-01-08T13:06:11.370Z","repository":{"id":57187975,"uuid":"49708507","full_name":"fixjs/awaitify","owner":"fixjs","description":"A simple wrapper for function generators","archived":false,"fork":false,"pushed_at":"2019-05-23T09:48:21.000Z","size":37,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-09T01:54:46.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fixjs.png","metadata":{"files":{"readme":"README.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":"2016-01-15T09:10:38.000Z","updated_at":"2022-04-25T13:45:58.000Z","dependencies_parsed_at":"2022-08-28T10:51:26.870Z","dependency_job_id":null,"html_url":"https://github.com/fixjs/awaitify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fixjs/awaitify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixjs%2Fawaitify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixjs%2Fawaitify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixjs%2Fawaitify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixjs%2Fawaitify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixjs","download_url":"https://codeload.github.com/fixjs/awaitify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixjs%2Fawaitify/sbom","scorecard":{"id":401885,"data":{"date":"2025-08-11","repo":{"name":"github.com/fixjs/awaitify","commit":"b01a2f095bc61dd3c2eceac55368b19d1ca61a54"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T20:15:40.325Z","repository_id":57187975,"created_at":"2025-08-18T20:15:40.326Z","updated_at":"2025-08-18T20:15:40.326Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28245377,"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":"2026-01-08T02:00:06.591Z","response_time":241,"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":[],"created_at":"2026-01-08T13:02:24.821Z","updated_at":"2026-01-08T13:06:11.365Z","avatar_url":"https://github.com/fixjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# awaitify v1.1.0\n[ ![Codeship Status for fixjs/awaitify](https://app.codeship.com/projects/1618ee20-bfdc-0134-54f6-02461f4386cc/status?branch=master)](https://app.codeship.com/projects/196778)\n[![Code Climate](https://codeclimate.com/github/fixjs/awaitify/badges/gpa.svg)](https://codeclimate.com/github/fixjs/awaitify)\n[![Download stats](https://img.shields.io/npm/dm/awaitify.svg)](https://www.npmjs.com/package/awaitify)\n\n\nA lightweight library to simplify asynchronous operations using function generators and `yield` keyword, which is an alternative for `Async/Await` keywords without having to use any Transpiler like babel. You could wrap the function generator inside this function like this:\n\n```javascript\nvar awaitify = require('awaitify');\n\nvar getUsers = awaitify(function*(){\n  // a xhr request to load users list\n  var users = yield jQuery.get('/api/users');\n  return users;\n});\n\ngetUsers()\n  .then((users)=\u003e{\n    console.log(users);\n  });\n\n// or\n\nvar users = yield getUsers();\nconsole.log(users);\n```\n\nwhich allows you await on a promise using `yield` keyword.\n\n# yield awaitify.map([], function* (){})\n```javascript\nconst mapList = function* (){\n  const mappedUsersInfoList = yield awaitify.map(usersList, function* (userObject){\n    const userInfo = yield loadUserInfo(userObject._id);\n    userInfo.baseData = userObject;\n    return userInfo;\n  });\n  // You can have access to the new list of usersInfo\n}.awaitify();\n```\n\n# awaitify.parallel({})\n```javascript\nconst loadData = function* (){\n  const { users, config } = yield awaitify.parallel({\n    users: function* () {\n      const users = yield getUsers();\n      console.log(users);\n      return users;\n    },\n    config: awaitify.fs.loadConfigFile('./package.json')\n  });\n  // You can have access to both users and config variable here\n}.awaitify();\n```\n\n# promise.then(function*(){})\nThis library also allows the pass generator functions to the promise chain implemented by this module:\n\n```javascript\ngetUsers()\n  .then(function *(users){\n    console.log(users);\n    var user = yield jQuery.get('/api/users/5698d6a5246af3c847be3000');\n    console.log(user);\n  });\n```\n\n# awaitify.cb\n\n```javascript\nvar awaitify = require('awaitify');\nvar fs = require('fs');\nvar readFile = path =\u003e awaitify.cb(cb =\u003e fs.readFile(path, 'utf8', cb)));\n\nvar main = awaitify(function*(){\n  var data;\n  try{\n    data = yield readFile('/any/file/path');\n  } catch (err) {\n    console.log(err, err.stack);\n  }\n  return data;\n});\n\nmain();\n\n// or\n\nreadFile('/any/file/path')\n  .then(data =\u003e console.log(data))\n  .catch(err =\u003e console.log(err, err.stack))\n```\n\n# awaitify.module\n\n```javascript\nconst SampleModuleV1 = awaitify.module({\n  *createSomething(){\n    let result = yield Promise.resolve('Something');\n    result += ' V1';\n    return result;\n  },\n});\n\nconst SampleModuleV2 = awaitify.module(SampleModuleV1 ,{\n  *createSomething(){\n    let result = yield SampleModuleV1.createSomething();\n    result += ', V2';\n    return result;\n  },\n});\n\nconst result = yield SampleModuleV2.createSomething();\nconsole.log(result); // \"Something V1, V2\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixjs%2Fawaitify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixjs%2Fawaitify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixjs%2Fawaitify/lists"}