Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 3, 2025
1 parent 914c433 commit 827de2e
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Create sync/async APIs with usable logic.

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

## Why & How

Please refer to Anthony's blog post: [**Async, Sync, in Between**](https://antfu.me/posts/async-sync-in-between).

## Usage

```bash
Expand Down Expand Up @@ -47,25 +51,6 @@ const result = myFunction.sync('./some-file.js')
const asyncResult = await myFunction.async('./some-file.js')
```

## Why

// TODO:

## How it works

// TODO:

## Benchmark

Run the following command to benchmark the performance of `quansync`:

```bash
pnpm run build && pnpm run benchmark
```

Benchmark results indicate that each `yield` incurs an overhead of
approximately 150 ns, comparable to that of `await sync()`. (On Apple M1 Max)

## Build-time Macro

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.
Expand Down Expand Up @@ -99,6 +84,17 @@ const asyncResult = await myFunction.async('./some-file.js')

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

## Benchmark

Run the following command to benchmark the performance of `quansync`:

```bash
pnpm run build && pnpm run benchmark
```

Benchmark results indicate that each `yield` incurs an overhead of
approximately 150 ns, comparable to that of `await sync()`. (On Apple M1 Max)

## Sponsors

<p align="center">
Expand Down

0 comments on commit 827de2e

Please sign in to comment.