Skip to content
PluginStats

prettier-plugin-nginx weekly downloads statistics

By jxddk · npm · Prettier plugins

NGINX configuration plugin for Prettier

View on npm Fresh · Oct 17, 2026

prettier-plugin-nginx has 2,409 recorded weekly downloads on npm, a decrease of 58.1% over the past 30 days.

It ranks #1240 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -70.5%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
2,409
Official API · Oct 17, 2026
7-day growth
-61.1%
-3.8K weekly downloads
30-day growth
-58.1%
-3.3K weekly downloads
90-day growth
-70.5%
-5.7K weekly downloads
Rank
#1240
Among tracked npm listings

About prettier-plugin-nginx

Prettier for NGINX

A Prettier plugin that formats NGINX configuration files, including OpenResty *_by_lua_block directives. It is written in TypeScript, depends only on Prettier, and needs Prettier 3.6 or later.

Getting Started

Install Prettier and the plugin:

Register the plugin in your Prettier configuration:

The plugin formats these files automatically:

• files with the extensions .nginx, .nginxconf and .vhost, • nginx.conf, mime.types, fastcgi_params, fastcgi.conf, scgi_params, uwsgi_params, proxy_params, koi-utf, koi-win and win-utf, • inside a directory named nginx: any .conf or .template file, such as docker/nginx/default.conf, and any file in a sites-available, sites-enabled, conf.d or snippets directory, such as /etc/nginx/sites-available/default, apart from dotfiles, certificates, scripts, logs and backups. List anything else that lives there, such as a supervisord.conf, in .prettierignore.

To format other files, assign them the nginx parser with an override:

Or from the command line:

Example

A messy file like this...

...is transformed to this:

Formatting

This plugin, like Prettier, is opinionated. The style follows the configuration examples in the NGINX documentation:

• Blocks are indented by one tabWidth, four spaces by default. Block directives are separated from their neighbours by a blank line, and a single blank line between other statements is kept; blank lines at the start or end of a block are not. • The parameters of the simple directives in a block, or at the top level, are aligned to one column. A name that ends beyond the middle of the line stays out of the alignment, so one long name does not push everything else to the right. • Parameters that do not fit within printWidth wrap onto continuation lines; the first parameter stays on the directive's line. • Comments stay where they are: on their own line, after a ;, or after a { or } on the same line. A comment between a directive's parameters ends the line it is on, and one right before the ; or { moves after it, joining any comment already there. • Every word is printed exactly as written. Quotes, escapes, regular expressions and multi-line strings are never altered, and an if condition is only re-spaced as if (...), on one line. With endOfLine set to crlf, the line breaks inside multi-line strings change with the rest of the file, and a word continued across lines with a backslash would be split, so keep the default lf for such files. cr is refused, since NGINX ends comments only at a line feed. • *_by_lua_block bodies are re-indented as a unit; the Lua inside them is not otherwise changed, and lines inside [[...]] long brackets are kept byte for byte. If a Prettier plugin providing a lua parser is loaded, the Lua is formatted with it instead. • A # prettier-ignore comment on its own line keeps the next statement, including a block and its original inner indentation, exactly as written. Other comments and blank lines may sit between the two. • Range formatting (--range-start, --range-end) is not supported; with a range the file is left unchanged. • # @format or # @prettier on the first line works with --require-pragma and --insert-pragma, and # @noformat or # @noprettier with --check-ignore-pragma.

Invalid configuration, such as a directive without its ;, is reported as a syntax error with its location; NGINX would reject it too. Template syntax is not supported: {{ ... }} is rejected as a stray brace, and is not detected at all, so it would be merged into the surrounding directive. envsubst style ${VAR} references are fine.

Configuration

The following options are available.

| API Option | CLI Option | Default | Description |

| printWidth | --print-width | 80 | Same option as in Prettier | | tabWidth | --tab-width | 4 | Same option as in Prettier | | useTabs | --use-tabs | false | Same option as in Prettier | | alignDirectives | --align-directives | true | Align directive parameters within a block to the same column. | | alignUniversally | --align-universally | false | Align all directive parameters within a file to the same column. Requires alignDirectives. | | wrapParameters | --wrap-parameters | true | Wrap parameters to new lines to fit print width. | | continuationIndent | --continuation-indent | 2 | Additional indentation for wrapped lines. |

Note that tabWidth defaults to 4 rather than Prettier's 2, to match the NGINX documentation.

Contributing

Bug reports and pull requests are welcome on GitHub.

Development needs Node.js 24 (see .node-version). npm test builds the plugin and runs the test suite; CI also runs npm run typecheck and npm run format:check, and npm run coverage reports coverage. The fixtures under test/fixtures are grouped by case; each case holds two example configurations taken from the NGINX or OpenResty documentation or from NGINX's conf/ directory, cited on their first line and cut down to an excerpt where marked, and one written to break the formatter, next to their formatted output or expected error. A documented example is named after its source page or file and its position among that page's configuration examples. Run npm run test:update after an intentional change to the output.

License

The package is available as open source under the terms of the MIT License.

Description from the npm listing.

  • nginx
  • openresty
  • prettier
  • prettier-plugin
  • configuration
  • format
  • autoformat
  • autoformatter

Where prettier-plugin-nginx sits in the listing

Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

All npm2,248 listings · 113 pages · page 62, #20 (overall #1240)
All npm: every listing in weekly downloads order
PNG SVG
Prettier plugins241 listings · 13 pages · page 1, #15 (overall #15)
Prettier plugins: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-nginx weekly downloads on npm, last 90 days: 2,409 weekly downloads as of Oct 17, 2026, -70.5% over 90 days.prettier-plugin-nginxWeekly downloads on npm · Last 90 days2,409downloads / week-70.5% over 90 days02K4K6K8K10K12KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
prettier-plugin-nginx weekly downloads on npm, last 90 days: 2,409 weekly downloads as of Oct 17, 2026, -70.5% over 90 days.
PNG SVG

7/30/90-day growth

prettier-plugin-nginx weekly downloads growth on npm: -61.1% over 7 days, -58.1% over 30 days, -70.5% over 90 days.prettier-plugin-nginxWeekly downloads growth on npm2,409downloads / week now7-day growth-3,779 weekly downloads-61.1%30-day growth-3,341 weekly downloads-58.1%90-day growth-5,744 weekly downloads-70.5%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
prettier-plugin-nginx weekly downloads growth on npm: -61.1% over 7 days, -58.1% over 30 days, -70.5% over 90 days.
PNG SVG

Ranking history

prettier-plugin-nginx npm ranking history: currently #1240 (by weekly downloads).prettier-plugin-nginxnpm ranking · by weekly downloads · Last 90 days#1240current rank#1238#1239#1240#1241#1242Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
prettier-plugin-nginx npm ranking history: currently #1240 (by weekly downloads).
PNG SVG

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Recent observations

Full history (121)
Recent weekly downloads observations for prettier-plugin-nginx
Date (UTC)Weekly downloadsChange vs. previous
2,409-442
2,851-649
3,500-1.4K
4,946-1.2K
6,1240
6,124-98
6,222+34
6,188+13
6,175-56
6,231-421
6,652-690
7,342-1.7K
9,062-77
9,139—

Similar npm Prettier plugins plugins

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/prettier-plugin-nginx. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.