{"id":18783207,"url":"https://github.com/yukaii/synchronized-promise","last_synced_at":"2025-07-02T00:07:44.607Z","repository":{"id":51080255,"uuid":"121252584","full_name":"Yukaii/synchronized-promise","owner":"Yukaii","description":"Turn ES6 Promise into synchronize function call, a simple wrapper of deasync package","archived":false,"fork":false,"pushed_at":"2022-12-03T12:41:50.000Z","size":594,"stargazers_count":43,"open_issues_count":11,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T12:09:39.833Z","etag":null,"topics":["deasync","promise","synchronize"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/synchronized-promise","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/Yukaii.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":"2018-02-12T13:54:18.000Z","updated_at":"2025-03-24T02:03:11.000Z","dependencies_parsed_at":"2023-01-24T00:00:24.818Z","dependency_job_id":null,"html_url":"https://github.com/Yukaii/synchronized-promise","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukaii%2Fsynchronized-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukaii%2Fsynchronized-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukaii%2Fsynchronized-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukaii%2Fsynchronized-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yukaii","download_url":"https://codeload.github.com/Yukaii/synchronized-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710447,"owners_count":21149190,"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":["deasync","promise","synchronize"],"created_at":"2024-11-07T20:38:34.170Z","updated_at":"2025-04-13T12:09:47.470Z","avatar_url":"https://github.com/Yukaii.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# synchronized-promise\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n\n[![npm version](https://badge.fury.io/js/synchronized-promise.svg)](https://badge.fury.io/js/synchronized-promise)\n[![Build Status](https://travis-ci.org/Yukaii/synchronized-promise.svg?branch=master)](https://travis-ci.org/Yukaii/synchronized-promise)\n\nTurn ES6 Promise into synchronize function call, a simple wrapper of deasync package\n\n## Installation\n\n```js\nnpm install synchronized-promise --save\n```\n\n## Usage\n\nFirst, you need to require the `synchronized-promise` package, for JavaScript:\n\n```js\nconst sp = require('synchronized-promise')\n```\n\nFor TypeScript or ES6 later JavaScript:\n\n```ts\nimport sp from 'synchronized-promise'\n```\n\nThen call it as the following example:\n\n```js\n// An promise base async function\nlet asyncFunction = (value) =\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    setTimeout(function () {\n      resolve(value)\n    }, 2000)\n  })\n}\n\n// regular usage\nasyncFunction(5).then(value =\u003e value === 5)\n\n// make it synchronized\nlet syncFunc = sp(asyncFunction)\nconst value = syncFunc(5) // value === 5\n```\n\nSee [`test.js`](https://github.com/Yukaii/synchronized-promise/blob/master/test.js) for usage in details.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/masquevil\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/3344691?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e侠小然\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Yukaii/synchronized-promise/commits?author=masquevil\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/clar-cmp\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/54909317?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eClar Charron\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Yukaii/synchronized-promise/commits?author=clar-cmp\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/papb\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/20914054?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePedro Augusto de Paula Barbosa\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Yukaii/synchronized-promise/commits?author=papb\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukaii%2Fsynchronized-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyukaii%2Fsynchronized-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukaii%2Fsynchronized-promise/lists"}