{"id":18273401,"url":"https://github.com/blinet/awaitif","last_synced_at":"2025-04-09T03:40:27.047Z","repository":{"id":39166055,"uuid":"498569106","full_name":"blinet/awaitif","owner":"blinet","description":"It's a package that makes await more useful and it's much more useful for ordering the conditions which requires time, so in this package you can use the conditions and if the given condition is true it will go to the next lines","archived":false,"fork":false,"pushed_at":"2022-06-24T02:44:41.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T07:16:27.778Z","etag":null,"topics":["await","await-async","await-promises","conditions","if"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blinet.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":"2022-06-01T02:48:19.000Z","updated_at":"2022-06-01T03:25:05.000Z","dependencies_parsed_at":"2022-09-26T21:11:50.728Z","dependency_job_id":null,"html_url":"https://github.com/blinet/awaitif","commit_stats":null,"previous_names":["4i8/awaitif"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blinet%2Fawaitif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blinet%2Fawaitif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blinet%2Fawaitif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blinet%2Fawaitif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blinet","download_url":"https://codeload.github.com/blinet/awaitif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974584,"owners_count":21026742,"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":["await","await-async","await-promises","conditions","if"],"created_at":"2024-11-05T12:06:17.617Z","updated_at":"2025-04-09T03:40:27.010Z","avatar_url":"https://github.com/blinet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n \u003ca href=\"https://www.npmjs.com/package/awaitif\"\u003e\u003cimg  src=\"https://raw.githubusercontent.com/4i8/awaitif/master/logo/awaitif.png\" width=\"400\" alt=\"awaitif\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n \u003ca href=\"https://github.com/arosteam\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=powered%20by\u0026message=Aros\u0026color=000636\u0026style=for-the-badge\u0026logo=Windows%20Terminal\u0026logoColor=fff\"/\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/awaitif\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/awaitif.svg?style=for-the-badge\" alt=\"NPM version\" /\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/awaitif\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/awaitif.svg?maxAge=3600\u0026style=for-the-badge\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# New Updates\n\n```\nFix Some Bugs\nand remove some unused code\n- awif.condition = /*condition*/;\n\n```\n\n## About\n\nIt's a package that makes await more useful and it's much more useful for ordering the conditions which requires time, so in this package you can use the conditions and if the given condition is true it will go to the next lines\n\n- Speed\n- Easy to use\n- useful\n\n## Installation\n\n```sh-session\nnpm install awaitif\nyarn add awaitif\n```\n\n## How to use\n\n```js\nconst awaitif = require(\"awaitif\");\nconst awif = new awaitif();\n```\n\n\u003e **Options**\n\n```js\n limit: 10000,\n/**\n * {default: 10000, type: Number}\n */\n //limit is the time in milliseconds If time is ended and the process is not executed you will get an error\n\n```\n\n\u003e **Method and Properties**\n\n```js\n/**\n * follow the process\n */\nawif.continue();\n/**\n * This function puts it at the line that you do not want the compiler to cross before the condition is true\n * @param {function} callback\n */\nawif.finally();\n```\n\n### Example\n\n```js\nconst awaitif = require(\"awaitif\");\n//This function is just an example, no need to use it\nfunction example() {\n  return new Promise((resolve, reject) =\u003e {\n    setTimeout(() =\u003e {\n      resolve(\"Hi\");\n    }, 5000);\n  });\n}\n//main example\n(async () =\u003e {\n  const awif = new awaitif();\n  example().then((res) =\u003e {\n    if (res === \"Hi\") {\n      awif.continue();\n    }\n  });\n  await awif.finally(function (err) {\n    //If you change the limit to 0,\n    //the callback will not work because there is no limit The condition must be true in order to continue\n\n    // if the required limit is exceeded\n    // and the condition is false, you'll get this error\n    if (err) {\n      // If you want to follow the process and continue to the other lines put\n      // awif.continue();\n      return console.log(err);\n    }\n  });\n  //do something...\n  console.log(\"The condition is true or continue\");\n})();\n```\n\n## Links\n\n- [Twiter](https://twitter.com/onlyarth)\n- [Github](https://github.com/4i8)\n\n## License\n\n- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)\n\n# awaitif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblinet%2Fawaitif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblinet%2Fawaitif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblinet%2Fawaitif/lists"}