{"id":17598084,"url":"https://github.com/potch/promise.js","last_synced_at":"2025-04-30T06:07:59.268Z","repository":{"id":9424476,"uuid":"11296232","full_name":"potch/promise.js","owner":"potch","description":"No longer under active development!","archived":false,"fork":false,"pushed_at":"2013-12-30T00:12:54.000Z","size":148,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T06:07:47.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/jakearchibald/ES6-Promises","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/potch.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":"2013-07-09T22:45:40.000Z","updated_at":"2023-06-24T16:16:44.000Z","dependencies_parsed_at":"2022-09-03T21:13:15.128Z","dependency_job_id":null,"html_url":"https://github.com/potch/promise.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Fpromise.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Fpromise.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Fpromise.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potch%2Fpromise.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potch","download_url":"https://codeload.github.com/potch/promise.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651233,"owners_count":21621716,"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":[],"created_at":"2024-10-22T09:44:24.755Z","updated_at":"2025-04-30T06:07:59.234Z","avatar_url":"https://github.com/potch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promise.js is no longer under active development!\n\n[jarchibald/ES6-Promises](https://github.com/jakearchibald/ES6-Promises) does everything this library was set out to do.\n\n# promise.js\n\n[\u003cimg align=\"right\" alt=\"Promises/A+ 1.0 compliant\" src=\"http://promisesaplus.com/assets/logo-small.png\"\u003e](http://promisesaplus.com/)\n\nA Minimal, fully Promises/A+ compliant library.\n\nPromises/A+ spec here: http://promisesaplus.com/\n\n[![Build Status](https://travis-ci.org/potch/promise.js.png)](https://travis-ci.org/potch/promise.js)\n\n# Usage\n\n* `promise()` - Creates a promise. Can pass an optional `obj` argument. If passed, promise methods are attached to passed object.\n* `promise.isPromise(obj)` - Uses duck-typing to check whether the given object is a 'promise' (does it have a `then` method?)\n* `promise.avow(fn)` - wrap a function in a promise. Use like so:\n\n```js\nvar add = promise.avow(function (fulfill, reject, a, b) {\n  if (a \u003c= 2 \u0026\u0026 b \u003c= 2) {\n    fulfill(a + b);\n  } else {\n    reject('Math is hard.');\n  }\n});\nadd(1, 1).then(console.log);\n```\n\n## Promise Methods\n\n* `then(onFulfill, onReject)` - bind fulfillment/rejection handlers to the promise. Returns a promise object\n* `fulfill(value)` - fulfills the promise with the passed value.\n* `reject(reason)` - rejects the promise with the passed reason.\n\nFor all behaviors, see the [spec](http://promisesaplus.com/ \"Promises/A+ Specification\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotch%2Fpromise.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotch%2Fpromise.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotch%2Fpromise.js/lists"}