{"id":18563114,"url":"https://github.com/compulim/has-resolved","last_synced_at":"2025-12-24T10:28:39.417Z","repository":{"id":31108048,"uuid":"126907870","full_name":"compulim/has-resolved","owner":"compulim","description":"Checks if a Promise is resolved or rejected asynchronously","archived":false,"fork":false,"pushed_at":"2023-01-06T01:32:51.000Z","size":1111,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T16:02:57.833Z","etag":null,"topics":["asynchronous","promise","rejection","resolution"],"latest_commit_sha":null,"homepage":"","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/compulim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-03-27T00:52:05.000Z","updated_at":"2020-05-26T08:47:09.000Z","dependencies_parsed_at":"2023-01-14T18:21:21.766Z","dependency_job_id":null,"html_url":"https://github.com/compulim/has-resolved","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fhas-resolved","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fhas-resolved/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fhas-resolved/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fhas-resolved/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compulim","download_url":"https://codeload.github.com/compulim/has-resolved/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248151325,"owners_count":21056071,"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":["asynchronous","promise","rejection","resolution"],"created_at":"2024-11-06T22:11:51.089Z","updated_at":"2025-04-10T03:32:31.345Z","avatar_url":"https://github.com/compulim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# has-resolved\n\nChecks if a Promise is resolved or rejected asynchronously\n\n[![npm version](https://badge.fury.io/js/has-resolved.svg)](https://badge.fury.io/js/has-resolved) [![Build Status](https://travis-ci.org/compulim/has-resolved.svg?branch=master)](https://travis-ci.org/compulim/has-resolved)\n\n# How to use\n\nResolution and rejection checks are asynchronous. You can use ES6 `async`/`await` to simplify coding.\n\n## Check for resolution\n\n```js\nimport hasResolved from 'has-resolved';\n\nconst promise = Promise.resolve();\nconst resolved = await hasResolved(promise);\n\nexpect(resolved).toBeTruthy();\n```\n\n\u003e Please note that `hasResolved` is an asynchronous function and need to be `await`-ed.\n\n## Check for rejection\n\n```js\nimport { hasRejected } from 'has-resolved';\n\nconst promise = Promise.reject();\nconst rejected = await hasRejected(promise);\n\nexpect(rejected).toBeTruthy();\n```\n\n\u003e `hasRejected` is not a default export, thus, the bracelets is needed for named import.\n\n# Contributions\n\nLike us? [Star](https://github.com/compulim/has-resolved/stargazers) us.\n\nWant to make it better? [File](https://github.com/compulim/has-resolved/issues) us an issue.\n\nDon't like something you see? [Submit](https://github.com/compulim/has-resolved/pulls) a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fhas-resolved","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompulim%2Fhas-resolved","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fhas-resolved/lists"}