From 09024bac753a289bfdd5ecf4dac799e54aa02a1b Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 28 Jan 2024 16:31:36 +0800 Subject: [PATCH] Add `@prettier/sync` to docs (#15977) --- docs/api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api.md b/docs/api.md index 47be4ec4e..50dab9a63 100644 --- a/docs/api.md +++ b/docs/api.md @@ -9,6 +9,8 @@ If you want to run Prettier programmatically, check this page out. import * as prettier from "prettier"; ``` +Our public APIs are all asynchronous, if you must use synchronous version for some reason, you can try [`@prettier/sync`](https://github.com/prettier/prettier-synchronized). + ## `prettier.format(source, options)` `format` is used to format text using Prettier. `options.parser` must be set according to the language you are formatting (see the [list of available parsers](options.md#parser)). Alternatively, `options.filepath` can be specified for Prettier to infer the parser from the file extension. Other [options](options.md) may be provided to override the defaults.