{"id":21146334,"url":"https://github.com/bhallstein/promise-pls","last_synced_at":"2025-03-14T13:44:12.664Z","repository":{"id":57331406,"uuid":"117972541","full_name":"bhallstein/promise-pls","owner":"bhallstein","description":"Initialize a promise","archived":false,"fork":false,"pushed_at":"2018-01-18T11:33:18.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T14:38:28.542Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhallstein.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":"2018-01-18T11:12:03.000Z","updated_at":"2020-06-02T08:08:02.000Z","dependencies_parsed_at":"2022-08-29T05:10:53.799Z","dependency_job_id":null,"html_url":"https://github.com/bhallstein/promise-pls","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/bhallstein%2Fpromise-pls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fpromise-pls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fpromise-pls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fpromise-pls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhallstein","download_url":"https://codeload.github.com/bhallstein/promise-pls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243589287,"owners_count":20315467,"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-11-20T08:52:27.774Z","updated_at":"2025-03-14T13:44:12.638Z","avatar_url":"https://github.com/bhallstein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promise-pls.js\n\nReturn an initialised promise, along with its resolve \u0026 reject methods.\n\n## Install:\n\n`npm i promise-pls --save`\n\n\n## Usage:\n\n```js\nimport promise_pls from 'promise-pls';\n\nfunction do_something() {\n  let { p, y, n } = promise_pls();\n\n  function cb(error) {\n    if (error) {\n      n(error);\n    }\n    else {\n      y();\n    }\n  }\n\n  run_task(cb);\n\n  return p;\n}\n\ndo_something()\n  .then(function() {\n    console.log('done!');\n  })\n  .catch(functoin(error) {\n    console.log('error:', error);\n  });\n```\n\n\n## Without promise-pls:\n\n```js\nlet [y, n];\nlet p = new Promise(function(_y, _n) {\n  [y, n] = [_y, _n];\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fpromise-pls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhallstein%2Fpromise-pls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fpromise-pls/lists"}