synchronized-promise
Advanced tools
Comparing version
{ | ||
"name": "synchronized-promise", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Turn ES6 Promise into synchronize function call, a simple wrapper of deasync package", | ||
"main": "dist/index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
@@ -7,0 +8,0 @@ "prepublishOnly": "npm run build", |
@@ -17,5 +17,17 @@ # synchronized-promise | ||
First, you need to require the `synchronized-promise` packgage, for JavaScript: | ||
```js | ||
const sp = require('synchronized-promise') | ||
``` | ||
For TypeScript or ES6 later JavaScript: | ||
```ts | ||
import sp from 'synchronized-promise' | ||
``` | ||
Then call it as the following example: | ||
```js | ||
// An promise base async function | ||
@@ -38,3 +50,3 @@ let asyncFunction = (value) => { | ||
See [`test.js`](https://github.com/Yukaii/synchronized-promise/blob/master/test.js) for usage in detail | ||
See [`test.js`](https://github.com/Yukaii/synchronized-promise/blob/master/test.js) for usage in details. | ||
@@ -46,11 +58,15 @@ ## Contributors ✨ | ||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
<!-- prettier-ignore-start --> | ||
<!-- markdownlint-disable --> | ||
<table> | ||
<tr> | ||
<td align="center"><a href="https://github.com/masquevil"><img src="https://avatars1.githubusercontent.com/u/3344691?v=4" width="100px;" alt="侠小然"/><br /><sub><b>侠小然</b></sub></a><br /><a href="https://github.com/Yukaii/synchronized-promise/commits?author=masquevil" title="Code">💻</a></td> | ||
<td align="center"><a href="https://github.com/masquevil"><img src="https://avatars1.githubusercontent.com/u/3344691?v=4" width="100px;" alt=""/><br /><sub><b>侠小然</b></sub></a><br /><a href="https://github.com/Yukaii/synchronized-promise/commits?author=masquevil" title="Code">💻</a></td> | ||
<td align="center"><a href="https://github.com/clar-cmp"><img src="https://avatars3.githubusercontent.com/u/54909317?v=4" width="100px;" alt=""/><br /><sub><b>Clar Charron</b></sub></a><br /><a href="https://github.com/Yukaii/synchronized-promise/commits?author=clar-cmp" title="Code">💻</a></td> | ||
</tr> | ||
</table> | ||
<!-- markdownlint-enable --> | ||
<!-- prettier-ignore-end --> | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! |
9345
14.59%9
12.5%147
12.21%70
32.08%