{"id":13717299,"url":"https://github.com/calvinmetcalf/lie","last_synced_at":"2025-05-14T15:11:24.261Z","repository":{"id":10097521,"uuid":"12159312","full_name":"calvinmetcalf/lie","owner":"calvinmetcalf","description":"A basic but performant promise implementation.","archived":false,"fork":false,"pushed_at":"2020-08-21T14:09:23.000Z","size":375,"stargazers_count":745,"open_issues_count":5,"forks_count":61,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-12T01:52:17.550Z","etag":null,"topics":[],"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/calvinmetcalf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-16T13:24:23.000Z","updated_at":"2025-04-07T13:20:56.000Z","dependencies_parsed_at":"2022-09-05T16:51:44.099Z","dependency_job_id":null,"html_url":"https://github.com/calvinmetcalf/lie","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Flie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Flie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Flie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Flie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmetcalf","download_url":"https://codeload.github.com/calvinmetcalf/lie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505873,"owners_count":21115354,"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-08-03T00:01:20.469Z","updated_at":"2025-04-12T01:52:21.097Z","avatar_url":"https://github.com/calvinmetcalf.png","language":"JavaScript","funding_links":[],"categories":[":mortar_board: 搜罗一切酷酷的东西","JavaScript","Promises/A+ Implementations (ES6/ES2015 compatible)"],"sub_categories":["Strict Implementations"],"readme":"# lie\n\n[\u003cimg src=\"https://promisesaplus.com/assets/logo-small.png\" alt=\"Promises/A+ logo\" title=\"Promises/A+ 1.1 compliant\" align=\"right\" /\u003e](https://promisesaplus.com)\n[\u003cimg src=\"https://travis-ci.org/calvinmetcalf/lie.svg\" alt=\"Build status\" title=\"Build status\" align=\"right\" /\u003e](https://travis-ci.org/calvinmetcalf/lie)\n\nlie is a small, performant promise library implementing the [Promises/A+ spec](http://promises-aplus.github.com/promises-spec/) (Version 1.1).\n\nOriginally a fork of [Ruben Verborgh](https://github.com/RubenVerborgh)'s [promiscuous](https://github.com/RubenVerborgh/promiscuous), with version 2.6 it became a fork of [ayepromise](https://github.com/cburgmer/ayepromise) by [Chris Burgmer](https://github.com/cburgmer).\n\n```bash\nnpm install lie\n\n```\n\n```javascript\nvar Promise = require('lie');\n// or use the pollyfill\nrequire('lie/polyfill');\n```\n\n## Usage\n\nEither use it with [browserify](http://browserify.org/) (recommended) or grab one of the files from the dist folder:\n\n- lie.js/lie.min.js exposes 'Promise' either as a UMD module or from the global scope, depending on if a CJS or AMD loader is available.\n- lie.polyfill.js/lie.polyfill.min.js adds 'Promise' to the global scope only if it's not already defined (not a UMD).\n\n## API\n\nImplements the standard ES6 api:\n\n```js\nnew Promise(function(resolve, reject){\n    doSomething(function(err, result) {\n        if (err) {\n            reject(err);\n        } else {\n            resolve(result);\n        }\n    });\n}).then(function (value) {\n    //on success\n}, function (reason) {\n    //on error\n}).catch(function (reason) {\n    //shortcut for error handling\n});\n\nPromise.all([\n    //array of promises or values\n]).then(function ([/* array of results */]));\n\nPromise.race([\n    //array of promises or values\n]);\n// either resolves or rejects depending on the first value to do so\n```\n\n## Unhandled Rejections\n\nIn Node.js, lie emits an `unhandledRejection` event when a rejected promise isn't caught, in line with [how io.js does it](https://iojs.org/api/process.html#process_event_unhandledrejection). This allows it to act as a promise shim in both Node.js and the browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Flie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmetcalf%2Flie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Flie/lists"}