{"id":26054686,"url":"https://github.com/avdaredevil/promise-enhancements","last_synced_at":"2026-04-17T18:32:58.726Z","repository":{"id":65475795,"uuid":"243668314","full_name":"avdaredevil/promise-enhancements","owner":"avdaredevil","description":"Enhances Promises in JavaScript to allow for more advanced chaining, retrying, etc","archived":false,"fork":false,"pushed_at":"2021-06-15T11:38:08.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T03:45:41.885Z","etag":null,"topics":["async-await","javascript","nodejs","promise","promise-map","retry"],"latest_commit_sha":null,"homepage":null,"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/avdaredevil.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":"2020-02-28T03:15:36.000Z","updated_at":"2021-06-15T11:38:11.000Z","dependencies_parsed_at":"2023-01-25T06:15:28.709Z","dependency_job_id":null,"html_url":"https://github.com/avdaredevil/promise-enhancements","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avdaredevil/promise-enhancements","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avdaredevil%2Fpromise-enhancements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avdaredevil%2Fpromise-enhancements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avdaredevil%2Fpromise-enhancements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avdaredevil%2Fpromise-enhancements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avdaredevil","download_url":"https://codeload.github.com/avdaredevil/promise-enhancements/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avdaredevil%2Fpromise-enhancements/sbom","scorecard":{"id":217838,"data":{"date":"2025-08-11","repo":{"name":"github.com/avdaredevil/promise-enhancements","commit":"b3100461d4da55b63262f1e000221fc58eefcdd0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 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":"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":"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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}}]},"last_synced_at":"2025-08-17T01:57:57.783Z","repository_id":65475795,"created_at":"2025-08-17T01:57:57.783Z","updated_at":"2025-08-17T01:57:57.783Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31940909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["async-await","javascript","nodejs","promise","promise-map","retry"],"created_at":"2025-03-08T09:13:00.306Z","updated_at":"2026-04-17T18:32:58.701Z","avatar_url":"https://github.com/avdaredevil.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promise-Enhancements\nThis library enhances the `Promise` base class by adding many various additional functions: (with examples)\n\n## Installation\nStandard npm install:\n```shell\nnpm install promise-enhancements\n```\n\n## API\n### Static functions\n- `Promise.retry(fn, options)`: \n    \u003e Retry function for repeated validation on Promise\n    \u003e Other options: `{times: 1, delay: 500, printErrors: false, errorPrefix: ''}`\n    ```js\n    async function worksFifthTime() {\n        const c = window.count = (window.count || 0) + 1\n        if (c \u003e 4) return 'Yay'\n        throw 'Nay'\n    }\n    Promise.retry(worksFifthTime, {retries: 2}) // Error: Nay, Nay\n    Promise.retry(worksFifthTime, {retries: 8}) // Yay\n    ```\n    \n- `Promise.firstSuccess(arr)`:\n    \u003e Like `Promise.map`, but will yield at the first success. It will fail if all cases are rejections\n    ```js\n    Promise.firstSuccess([\n        Promise.reject(10),\n        Promise.reject(20),\n    ]) // = Error: 10, 20\n\n    Promise.firstSuccess([\n        Promise.reject(10),\n        20,\n        Promise.reject(30),\n    ]) // = 20\n    ```\n- `Promise.sync(tasks)`\n    \u003e Runs an array of async functions in sequence (where the output of the previous callback is the input for the next)\n    ```js\n    const increment = n =\u003e n+1\n    const getServerCount = async domain =\u003e /* returns a number */\n\n    Promise.sync(['domain.com', getServerCount, increment, increment])\n    // Output: ['domain.com', 10, 11, 12]\n    ```\n\n### Dynamic functions\n- `\u003cpromise\u003e.returns(value)`: \n    \u003e Uses the value provided as the argument as the seed for the next step\n    ```js\n    Promise.resolve(1)\n        .then(add1)\n        .returns(0)\n        .then(add1) // = await add1(0) = 1\n    // While all steps in the chain ran, the next element after return uses the new value\n    ```\n- `\u003cpromise\u003e.sleep(value)`: \n    \u003e Sleeps on current step in the chain\n    ```js\n    Promise.resolve('//computername')\n        .then(restartComputer)\n        .return('//computername')\n        .sleep(10e3) // 10s\n        .then(checkIfOnline)\n    ```\n- `\u003cpromise\u003e.print(value)`: \n    \u003e Uses the value provided as the argument as the seed for the next step\n    ```js\n    Promise.resolve(1)\n        .print('Starting Chain with 1')\n        .then(add1)\n        .print(v =\u003e `New Value = ${v}`)       // Callback print syntax\n        .print('Ending Chain', console.error) // Prints as an error\n    ```\n- `\u003cpromise\u003e.map(value)`: \n    \u003e Same usage as `Array.map` but on promises! Same as `\u003cpromise\u003e.then(arr =\u003e Promise.all(arr.map(callback))`.\n    ```js\n    Promise.resolve([1,2,3,4,5])\n        .map(i =\u003e i**2)\n        .map(fetchGithubUserByID) // Async task\n        .map(i =\u003e i.user.image)\n\n    // Fetches github profile images for Users: 1, 4, 9, 16, and 25\n    ```\n- `\u003cpromise\u003e.sync(callback)`: \n    \u003e Like `\u003cpromise\u003e.map` but each task runs in sequence.\n    \u003e Task = `callback(input[task_index])` where task_index = `0..(input.length)`\n    ```js\n    Promise.resolve(['jon', 'ally', 'ap'])\n        .sync(restartComputer)\n\n    // Restart('jon'), if success only then restart('ally'), etc\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favdaredevil%2Fpromise-enhancements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favdaredevil%2Fpromise-enhancements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favdaredevil%2Fpromise-enhancements/lists"}