{"id":24567303,"url":"https://github.com/autonomoussoftware/promise-find","last_synced_at":"2025-04-22T12:50:32.994Z","repository":{"id":48894495,"uuid":"209630459","full_name":"autonomoussoftware/promise-find","owner":"autonomoussoftware","description":"Find the promise call that satisfies the testing function","archived":false,"fork":false,"pushed_at":"2021-07-06T17:46:27.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-08T10:52:12.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/autonomoussoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-19T19:12:18.000Z","updated_at":"2021-02-22T14:30:18.000Z","dependencies_parsed_at":"2022-09-26T20:20:31.490Z","dependency_job_id":null,"html_url":"https://github.com/autonomoussoftware/promise-find","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Fpromise-find","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Fpromise-find/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Fpromise-find/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Fpromise-find/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autonomoussoftware","download_url":"https://codeload.github.com/autonomoussoftware/promise-find/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250243799,"owners_count":21398399,"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":"2025-01-23T13:17:40.126Z","updated_at":"2025-04-22T12:50:32.971Z","avatar_url":"https://github.com/autonomoussoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promise-find\n\n[![Build Status](https://travis-ci.com/autonomoussoftware/promise-find.svg?branch=master)](https://travis-ci.com/autonomoussoftware/promise-find)\n[![Code Style](https://img.shields.io/badge/code%20style-bloq-0063a6.svg)](https://github.com/bloq/eslint-config-bloq)\n[![Known Vulnerabilities](https://snyk.io/test/github/autonomoussoftware/promise-find/badge.svg?targetFile=package.json)](https://snyk.io/test/github/autonomoussoftware/promise-find?targetFile=package.json)\n\nFind the promise call that satisfies the testing function.\n\n## Installation\n\n```shell\nnpm install promise-find\n```\n\n## Usage\n\n```js\nconst promiseFind = require('promise-find')\n\npromiseFind([\n  () =\u003e Promise.resolve(null),\n  () =\u003e Promise.resolve('match'),\n  () =\u003e Promise.reject(new Error('never called')),\n  () =\u003e Promise.resolve('never called either')\n]).then(function(result) {\n  console.log(result) // prints 'match'\n})\n```\n\n## API\n\n### `promiseFind(list, test)`\n\nReturns a `Promise` that will resolve to the result of the first function call\nthat passes the test or `null` if no one passes the test.\nIf any function fails, the promise will be a rejected the error.\n\n#### `list`\n\nAn array of functions that receive no arguments and return either a value or a\npromis.\n\n#### `test`\n\nThe function used to check for a match.\nIt defaults to the \"identity\" function so any truthy value will pass.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomoussoftware%2Fpromise-find","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautonomoussoftware%2Fpromise-find","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomoussoftware%2Fpromise-find/lists"}