Update README.md to include pnpm and pnpx commands for installing and formatting with prettier-plugin-openapi

This commit is contained in:
Luke Hagar
2025-09-26 18:05:41 +00:00
parent 04f04f99ce
commit 184a99a382

View File

@@ -30,6 +30,8 @@ A Prettier plugin for formatting OpenAPI/Swagger JSON and YAML files with intell
```bash ```bash
npm install --save-dev prettier-plugin-openapi npm install --save-dev prettier-plugin-openapi
# or # or
pnpm add --dev prettier-plugin-openapi
# or
yarn add --dev prettier-plugin-openapi yarn add --dev prettier-plugin-openapi
# or # or
bun add --dev prettier-plugin-openapi bun add --dev prettier-plugin-openapi
@@ -41,13 +43,13 @@ bun add --dev prettier-plugin-openapi
```bash ```bash
# Format a single file # Format a single file
npx prettier --write api.yaml pnpx prettier --write api.yaml
# Format all OpenAPI files in a directory # Format all OpenAPI files in a directory
npx prettier --write "**/*.{openapi.json,openapi.yaml,swagger.json,swagger.yaml}" pnpx prettier --write "**/*.{openapi.json,openapi.yaml,swagger.json,swagger.yaml}"
# Format with specific options # Format with specific options
npx prettier --write api.yaml --tab-width 4 --print-width 100 pnpx prettier --write api.yaml --tab-width 4 --print-width 100
``` ```
### Configuration ### Configuration