Skip to content

Commit 827de2e

Browse files
committed
docs: update
1 parent 914c433 commit 827de2e

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

README.md

+15-19
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Create sync/async APIs with usable logic.
1616

1717
Heavily inspired by [`genasync`](https://github.com/loganfsmyth/gensync) by [@loganfsmyth](https://github.com/loganfsmyth).
1818

19+
## Why & How
20+
21+
Please refer to Anthony's blog post: [**Async, Sync, in Between**](https://antfu.me/posts/async-sync-in-between).
22+
1923
## Usage
2024

2125
```bash
@@ -47,25 +51,6 @@ const result = myFunction.sync('./some-file.js')
4751
const asyncResult = await myFunction.async('./some-file.js')
4852
```
4953

50-
## Why
51-
52-
// TODO:
53-
54-
## How it works
55-
56-
// TODO:
57-
58-
## Benchmark
59-
60-
Run the following command to benchmark the performance of `quansync`:
61-
62-
```bash
63-
pnpm run build && pnpm run benchmark
64-
```
65-
66-
Benchmark results indicate that each `yield` incurs an overhead of
67-
approximately 150 ns, comparable to that of `await sync()`. (On Apple M1 Max)
68-
6954
## Build-time Macro
7055

7156
If you don't like the `function*` and `yield*` syntax, we also provide a build-time macro via [unplugin-quansync](https://github.com/unplugin/unplugin-quansync#usage) allowing you use quansync with async/await syntax, while still able to get the sync version out of that.
@@ -99,6 +84,17 @@ const asyncResult = await myFunction.async('./some-file.js')
9984

10085
For more details on usage, refer to [unplugin-quansync's docs](https://github.com/unplugin/unplugin-quansync#usage).
10186

87+
## Benchmark
88+
89+
Run the following command to benchmark the performance of `quansync`:
90+
91+
```bash
92+
pnpm run build && pnpm run benchmark
93+
```
94+
95+
Benchmark results indicate that each `yield` incurs an overhead of
96+
approximately 150 ns, comparable to that of `await sync()`. (On Apple M1 Max)
97+
10298
## Sponsors
10399

104100
<p align="center">

0 commit comments

Comments
 (0)