{"id":22731325,"url":"https://github.com/sno2/promisify","last_synced_at":"2026-05-05T07:34:00.360Z","repository":{"id":62422103,"uuid":"369714531","full_name":"sno2/promisify","owner":"sno2","description":"A promisify util for Deno.","archived":false,"fork":false,"pushed_at":"2021-05-22T04:54:19.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T21:47:00.013Z","etag":null,"topics":["deno","typescript"],"latest_commit_sha":null,"homepage":"https://deno.land/x/promisify","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sno2.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":"2021-05-22T04:31:29.000Z","updated_at":"2021-05-22T07:23:08.000Z","dependencies_parsed_at":"2022-11-01T17:33:06.475Z","dependency_job_id":null,"html_url":"https://github.com/sno2/promisify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fpromisify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fpromisify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fpromisify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fpromisify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sno2","download_url":"https://codeload.github.com/sno2/promisify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246264658,"owners_count":20749494,"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":["deno","typescript"],"created_at":"2024-12-10T19:21:28.916Z","updated_at":"2026-05-05T07:33:55.337Z","avatar_url":"https://github.com/sno2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promisify\n\nA simple Deno module for promisifying callback-based functions.\n\n## Usage\n\nFirst, import the module from the Deno Third-Party Modules Registry.  After\nthat, you can import the `promisify` utility function.\n\n```ts\nimport { promisify } from \"https://deno.land/x/promisify/mod.ts\";\n\nfunction add(a: number, b: number, cb: (sum: number) =\u003e void) {\n  cb(a + b);\n}\n\nconst sum = await promisify(add)(3, 5);\nconsole.log(sum); // 8\n\nfunction getItems(cb: (items: unknown[]) =\u003e void) {\n  throw Error(\"Unexpected.\");\n}\n\nconst items = await promisify(getItems)().catch((err) =\u003e {\n  console.error(err); // logs out the error because the function threw an error\n});\nconsole.log(items); // undefined\n```\n\n## License\n\n[Unlicense](./UNLICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsno2%2Fpromisify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsno2%2Fpromisify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsno2%2Fpromisify/lists"}