{"id":17239034,"url":"https://github.com/binarymuse/yubikiri","last_synced_at":"2026-01-19T05:33:16.400Z","repository":{"id":17953907,"uuid":"83073023","full_name":"BinaryMuse/yubikiri","owner":"BinaryMuse","description":"Fetch data using Promises. Pinky swear!","archived":false,"fork":false,"pushed_at":"2022-12-30T17:16:42.000Z","size":140,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T20:44:58.164Z","etag":null,"topics":["data-fetching","javascript","promises"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yubikiri","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/BinaryMuse.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":"2017-02-24T18:55:46.000Z","updated_at":"2019-03-07T17:03:30.000Z","dependencies_parsed_at":"2023-01-11T19:44:18.973Z","dependency_job_id":null,"html_url":"https://github.com/BinaryMuse/yubikiri","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BinaryMuse/yubikiri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fyubikiri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fyubikiri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fyubikiri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fyubikiri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryMuse","download_url":"https://codeload.github.com/BinaryMuse/yubikiri/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fyubikiri/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-fetching","javascript","promises"],"created_at":"2024-10-15T05:47:33.858Z","updated_at":"2026-01-19T05:33:16.384Z","avatar_url":"https://github.com/BinaryMuse.png","language":"JavaScript","readme":"# ゆびきり (Yubikiri)\n\nゆびきり (*yubikiri*, or \"pinky swear\") is a library to facilitate Promise-based data loading in JavaScript. You provide an object filled with plain values, Promises, or functions, and Yubikiri will order the dependencies and return a Promise that resolves to an object with all the sub-Promises resolved.\n\n## Installation\n\nYubikiri makes use of **Proxies**, **Reflect**, and **async/await**. Node.js v7.6.0 is the first version that supports Yubikiri.\n\nWith npm:\n\n```\nnpm install [--save] yubikiri\n```\n\n## Usage\n\nYubikiri exposes a single function that takes a JavaScript object. The keys of this object are names to be used in the result, and the values are Promises that will be resolved.\n\n```javascript\nconst data = await yubikiri({\n  one: Promise.resolve(1),\n  two: Promise.resolve(2)\n})\n\n// data === { one: 1, two: 2 }\n```\n\nYou can also specify functions that depend on other values being calculated at the same time. Yubikiri will take care of ensuring the values that depend on each other are resolved correctly. Each function is only calculated once, even if more than one other function depends on its value.\n\n```javascript\nconst data = await yubikiri(query =\u003e ({\n  one: Promise.resolve(1),\n  two: 2,\n  three: (query) =\u003e {\n    return query.one.then(one =\u003e {\n      return query.two.then(two =\u003e {\n        return one + two\n      })\n    })\n  }\n}))\n\n// data === { one: 1, two: 2, three: 3 }\n```\n\nIf you're using async/await, this pattern can be a little nicer:\n\n```javascript\nconst data = await yubikiri(query =\u003e ({\n  one: Promise.resolve(1),\n  two: Promise.resolve(2),\n  three: async (query) =\u003e {\n    const [one, two] = await Promise.all([query.one, query.two])\n    return one + two\n  }\n}))\n\n// data === { one: 1, two: 2, three: 3 }\n```\n\nIf any of the specified Promises reject, the overall Promise returned from Yubikiri will also reject with the same value.\n\nYubikiri will try to detect infinite loops and return a rejected Promise with an error message that describes the dependency loop.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymuse%2Fyubikiri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarymuse%2Fyubikiri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymuse%2Fyubikiri/lists"}