{"id":17458943,"url":"https://github.com/caseywebb/potato-promise","last_synced_at":"2026-02-01T06:33:13.992Z","repository":{"id":14748040,"uuid":"76997324","full_name":"caseyWebb/potato-promise","owner":"caseyWebb","description":":sweet_potato: ES6 Promises, but lazier.","archived":false,"fork":false,"pushed_at":"2023-03-04T04:01:50.000Z","size":10,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T23:34:40.122Z","etag":null,"topics":["lazy","lazy-evaluation","promise"],"latest_commit_sha":null,"homepage":"","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/caseyWebb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-20T22:46:15.000Z","updated_at":"2022-01-14T05:52:18.000Z","dependencies_parsed_at":"2024-10-20T19:48:29.060Z","dependency_job_id":null,"html_url":"https://github.com/caseyWebb/potato-promise","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"1225e101cec5c9d213effa09935ee182231e6fba"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/caseyWebb/potato-promise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseyWebb%2Fpotato-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseyWebb%2Fpotato-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseyWebb%2Fpotato-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseyWebb%2Fpotato-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caseyWebb","download_url":"https://codeload.github.com/caseyWebb/potato-promise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseyWebb%2Fpotato-promise/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261453151,"owners_count":23160455,"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":["lazy","lazy-evaluation","promise"],"created_at":"2024-10-18T04:37:57.766Z","updated_at":"2026-02-01T06:33:13.980Z","avatar_url":"https://github.com/caseyWebb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# potato-promise\n\n[![NPM Version](https://img.shields.io/npm/v/potato-promise.svg)](https://www.npmjs.com/package/potato-promise)\n![WTFPL](https://img.shields.io/npm/l/potato-promise.svg)\n[![Travis](https://img.shields.io/travis/caseyWebb/potato-promise.svg)](https://travis-ci.org/caseyWebb/potato-promise)\n[![NPM Downloads](https://img.shields.io/npm/dt/potato-promise.svg?maxAge=2592000)](http://npm-stat.com/charts.html?package=potato-promise\u0026author=\u0026from=\u0026to=)\n\nSuper [tiny](./index.js), dependency-free wrapper to make promises lazy, i.e. sit there like a potato until `.then()` is invoked.\n\nAssumes native promises, or at least `Promise` on the global scope (`global` or `window`).\n\n### Installation\n```bash\n$ npm i -S potato-promise\n```\n\n### Usage\n```javascript\nconst Potato = require('potato-promise')\n\nconst p = new Potato((resolve) =\u003e {\n  console.log(3)\n  resolve()\n})\n\nconsole.log(1)\n\nsetTimeout(() =\u003e {\n  console.log(2)\n  p.then(() =\u003e {}).catch(() =\u003e {})\n}, 1000)\n\n// \u003e 1\n// ...after 1 second...\n// \u003e 2\n// \u003e 3\n```\n\n__Note:__ I'm only using `new` here for familiar semantics; this is actually\na factory function. The following would also work...\n\n```javascript\nPromise.lazy = require('potato-promise')\n\nconst p = Promise.lazy((resolve) =\u003e ...)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaseywebb%2Fpotato-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaseywebb%2Fpotato-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaseywebb%2Fpotato-promise/lists"}