{"id":31425050,"url":"https://github.com/es-shims/promise.withresolvers","last_synced_at":"2025-09-30T04:55:14.206Z","repository":{"id":180497038,"uuid":"665135227","full_name":"es-shims/Promise.withResolvers","owner":"es-shims","description":"ES Proposal spec-compliant shim for Promise.withResolvers","archived":false,"fork":false,"pushed_at":"2024-03-22T21:59:22.000Z","size":39,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-16T16:13:30.849Z","etag":null,"topics":["defer","deferred","ecmascript","es-shims","javascript","polyfill","promise","shim","withresolvers"],"latest_commit_sha":null,"homepage":"https://tc39.es/proposal-promise-with-resolvers/","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/es-shims.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,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/es5-shim","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-07-11T14:07:08.000Z","updated_at":"2025-07-06T05:34:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6ee4786-da3d-4b0a-a3c8-d8a9eb819026","html_url":"https://github.com/es-shims/Promise.withResolvers","commit_stats":null,"previous_names":["es-shims/promise.withresolvers"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/es-shims/Promise.withResolvers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FPromise.withResolvers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FPromise.withResolvers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FPromise.withResolvers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FPromise.withResolvers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/es-shims","download_url":"https://codeload.github.com/es-shims/Promise.withResolvers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FPromise.withResolvers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277632370,"owners_count":25850734,"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":"2025-09-30T02:00:09.208Z","response_time":75,"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":["defer","deferred","ecmascript","es-shims","javascript","polyfill","promise","shim","withresolvers"],"created_at":"2025-09-30T04:55:09.457Z","updated_at":"2025-09-30T04:55:14.191Z","avatar_url":"https://github.com/es-shims.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/es5-shim"],"categories":[],"sub_categories":[],"readme":"# promise.withresolvers \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nES proposal spec-compliant shim for Promise.withResolvers. Invoke its \"shim\" method to shim `Promise.withResolvers` if it is unavailable or noncompliant. **Note**: a global `Promise` must already exist: the [es6-shim](https://github.com/es-shims/es6-shim) is recommended.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment that has `Promise` available globally, and complies with the [spec](https://tc39.es/proposal-promise-with-resolvers/).\n\nMost common usage:\n```js\nvar assert = require('assert');\nvar withResolvers = require('promise.withresolvers');\n\nvar obj = withResolvers(Promise);\nassert.equal(obj.promise instanceof Promise, true);\nassert.equal(typeof obj.resolve, 'function');\nassert.equal(typeof obj.reject, 'function');\n\nwithResolvers.shim(); // will be a no-op if not needed\n\nvar obj2 = Promise.withResolvers();\n\nassert.equal(obj2.promise instanceof Promise, true);\nassert.equal(typeof obj2.resolve, 'function');\nassert.equal(typeof obj2.reject, 'function');\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.com/package/promise.withresolvers\n[npm-version-svg]: https://versionbadg.es/es-shims/Promise.withResolvers.svg\n[deps-svg]: https://david-dm.org/es-shims/Promise.withResolvers.svg\n[deps-url]: https://david-dm.org/es-shims/Promise.withResolvers\n[dev-deps-svg]: https://david-dm.org/es-shims/Promise.withResolvers/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Promise.withResolvers#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/promise.withresolvers.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/promise.withresolvers.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/promise.withresolvers.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=promise.withresolvers\n[codecov-image]: https://codecov.io/gh/es-shims/Promise.withResolvers/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Promise.withResolvers/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Promise.withResolvers\n[actions-url]: https://github.com/es-shims/Promise.withResolvers/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fpromise.withresolvers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fes-shims%2Fpromise.withresolvers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fpromise.withresolvers/lists"}