Add @prettier/sync to docs (#15977)
This commit is contained in:
1 parent
a9b2e0f312
commit
09024bac75
1 file changed
+2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user