Skip to content
PluginStats

prettier-plugin-nginx weekly downloads statistics

By jxddk · npm · Prettier plugins

NGINX configuration plugin for Prettier

View on npm Fresh · Dec 6, 2026

prettier-plugin-nginx has 9,344 recorded weekly downloads on npm, an increase of 8.5% over the past 30 days, ranking #1291 of 3,247 tracked listings.

Weekly downloads
9,344
Official API · Dec 5, 2026
7-day growth
+2.4%
+221 weekly downloads
30-day growth
+8.5%
+730 weekly downloads
90-day growth
+107%
+4.8K weekly downloads
Rank
#1291
▼ 15 in 7 days

About prettier-plugin-nginx

<div align="center"> <img src="./.github/images/prettier-plugin-nginx.png" alt="Banner"> </div> <h1 align="center">Prettier for NGINX</h1> <hr>

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:

npm install --save-dev prettier prettier-plugin-nginx

Register the plugin in your Prettier configuration:

{
  "plugins": ["prettier-plugin-nginx"]
}

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:

{
  "plugins": ["prettier-plugin-nginx"],
  "overrides": [
    {
      "files": ["*.conf", "sites-enabled/*"],
      "options": { "parser": "nginx" }
    }
  ]
}

Or from the command line:

npx prettier --write --plugin prettier-plugin-nginx --parser nginx default.conf

Example

A messy file like this...

server {
# server definition
listen 443 ssl; listen [::]:443 ssl;
server_name example.com;
location / { proxy_pass http://proxy; proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1000; }
# end server definition
}

...is transformed to this:

server {
    # server definition
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name example.com;

    location / {
        proxy_pass         http://proxy;
        proxy_set_header   Host $http_host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_read_timeout 1000;
    }
    # end server definition
}

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.…

Description from the npm listing.

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

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

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

Adoption over time

prettier-plugin-nginx weekly downloads on npm, last 90 days: 9,344 weekly downloads as of Dec 5, 2026, +107% over 90 days.prettier-plugin-nginxWeekly downloads on npm · Last 90 days9,344downloads / week+107% over 90 days02K4K6K8K10K12K14KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-nginx weekly downloads on npm, last 90 days: 9,344 weekly downloads as of Dec 5, 2026, +107% over 90 days.

7/30/90-day growth

prettier-plugin-nginx weekly downloads growth on npm: +2.4% over 7 days, +8.5% over 30 days, +107% over 90 days.prettier-plugin-nginxWeekly downloads growth on npm9,344downloads / week now7-day growth+221 weekly downloads+2.4%30-day growth+730 weekly downloads+8.5%90-day growth+4,821 weekly downloads+107%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-nginx weekly downloads growth on npm: +2.4% over 7 days, +8.5% over 30 days, +107% over 90 days.

Ranking history

prettier-plugin-nginx npm ranking history: currently #1291 (by weekly downloads).prettier-plugin-nginxnpm ranking · by weekly downloads · Last 90 days#1291current rank#1100#1150#1200#1250#1300Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-nginx npm ranking history: currently #1291 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 65, #11 (overall #1,291)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 1, #16 (overall #16)
Prettier plugins: every listing in weekly downloads order

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.

Each band is one page of 20. Weekly downloads on a linear 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.

Recent observations

Full history (170)
Recent weekly downloads observations for prettier-plugin-nginx
Date (UTC)Weekly downloadsChange vs. previous
9,344+377
8,967+231
8,736+161
8,575-242
8,817-90
8,907-196
9,103-20
9,123-963
10,086-478
10,564-687
11,251-864
12,115+1.1K
10,983+442
10,541—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-nginx alternatives

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 Dec 6, 2026. See the methodology.