Skip to content
PluginStats

prettier-plugin-sh weekly downloads statistics

By un-ts (5 listings) · npm · Prettier plugins

An opinionated `shellscript` formatter plugin for Prettier, also support simple format of `Dockerfile`, `properties`, `gitignore`, `dotenv`, `hosts`, `jvmoptions`...

View on npm Fresh · Dec 6, 2026

prettier-plugin-sh has 428,004 recorded weekly downloads on npm, a decrease of 3.3% over the past 30 days, ranking #419 of 3,247 tracked listings.

Weekly downloads
428,004
Official API · Dec 5, 2026
7-day growth
+5.0%
+20.4K weekly downloads
30-day growth
-3.3%
-14.6K weekly downloads
90-day growth
+16.2%
+59.5K weekly downloads
Rank
#419
▼ 8 in 7 days

About prettier-plugin-sh

<p align="center"> <img src="https://raw.githubusercontent.com/un-ts/prettier/master/assets/sh.png" height="100" /> </p>

prettier-plugin-sh npm bundle size npm bundle size

An opinionated shellscript formatter plugin for [Prettier][], also support simple format of Dockerfile, properties, gitignore, dotenv, hosts, jvmoptions...

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing, taking various rules into account.

This plugin adds support for various file formats through [mvdan-sh][] via [sh-syntax][] and [dockerfmt][].

Notice

This plugin is still under development, its printer just wraps [mvdan-sh][]'s default printer with powered by [sh-syntax][]. Of course it should just work, but may not match [prettier][]'s format sometimes.

[!WARNING]

ignore files are not officially supported by [mvdan-sh][] what means only basic and simple ignore usage cases can be handled correctly. We cannot do much on our side. See also https://github.com/un-ts/prettier/issues/336.

Requirements

prettier-plugin-sh is an evergreen module. 🌲 This module requires an LTS Node version (v16.0.0+).

Install

Using npm:

# npm
npm i -D prettier prettier-plugin-sh

# yarn
yarn add -D prettier prettier-plugin-sh

Usage

Once installed, Prettier plugins must be added to .prettierrc:

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

Then:

# npx
npx prettier --write script.sh

# yarn
yarn prettier --write script.sh

Parser Options

interface ShOptions {
  // parser
  /**
   * KeepComments makes the parser parse comments and attach them to nodes, as
   * opposed to discarding them.
   */
  keepComments?: boolean
  /**
   * LangVariant describes a shell language variant to use when tokenizing and
   * parsing shell code. The zero value is [LangBash].
   */
  variant?: LangVariant
  /**
   * StopAt configures the lexer to stop at an arbitrary word, treating it as if
   * it were the end of the input. It can contain any characters except
   * whitespace, and cannot be over four bytes in size.
   *
   * This can be useful to embed shell code within another language, as one can
   * use a special word to mark the delimiters between the two.
   *
   * As a word, it will only apply when following whitespace or a separating
   * token. For example, StopAt("$$") will act on the inputs "foo $$" and
   * "foo;$$", but not on "foo '$$'".
   *
   * The match is done by prefix, so the example above will also act on "foo
   * $$bar".
   */
  stopAt?: string
  /**
   * RecoverErrors allows the parser to skip up to a maximum number of errors in
   * the given input on a best-effort basis. This can be useful to tab-complete
   * an interactive shell prompt, or when providing diagnostics on slightly
   * incomplete shell source.
   *
   * Currently, this only helps with mandatory tokens from the shell grammar
   * which are not present in the input. They result in position fields or nodes
   * whose position report [Pos.IsRecovered] as true.
   *
   * For example, given the input
   *
   *     (foo |
   *
   * The result will contain two recovered positions; first, the pipe requires a
   * statement to follow, and as [Stmt.Pos] reports, the entire node is
   * recovered. Second, the subshell needs to be closed, so [Subshell.Rparen] is
   * recovered.
   */
  recoverErrors?: number
  /**
   * KeepComments makes the parser parse comments and attach them to nodes, as
   * opposed to discarding them.
   *
   * @default true
   */
  keepComments: boolean
  /**
   * LangVariant describes a shell language variant to use when tokenizing and
   * parsing shell code. The zero value is [LangBash].
   */
  variant: LangVariant
  /**
   * StopAt configures the lexer to stop at an arbitrary word, treating it as if
   * it were the end of the input. It can contain any characters except
   * whitespace, and cannot be over four bytes in size.
   *
   * This can be useful to embed shell code within another language, as one can
   * use a special word to mark the delimiters between the two.
   *
   * As a word, it will only apply when following whitespace or a separating
   * token. For example, StopAt("$$") will act on the inputs "foo $$" and
   * "foo;$$", but not on "foo '$$'".
   *
   * The match is done by prefix, so the example above will also act on "foo
   * $$bar".
   */
  stopAt: string
  /**
   * RecoverErrors allows the parser to skip up to a maximum number of errors in
   * the given input on a best-effort basis. This can be useful to tab-complete
   * an interactive shell prompt, or when providing diagnostics on slightly
   * incomplete shell source.
   *
   * Currently, this only helps with mandatory tokens from the shell grammar
   * which are not present in the input. They result in position fields or nodes
   * whose position report [Pos.IsRecovered] as true.
   *
   * For example, given the input
   *
   *     (foo |
   *
   * The result will contain two recovered positions; first, the pipe requires a
   * statement to follow, and as [Stmt.Pos] reports, the entire node is
   * recovered. Second, the subshell needs to be closed, so [Subshell.Rparen] is
   * recovered.
   */
  recoverErrors: number…

Description from the npm listing.

  • dockerfile
  • ini
  • properties
  • sh
  • shell
  • shellscript
  • plugin
  • prettier
  • prettier-plugin

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-sh weekly downloads on npm, last 90 days: 428,004 weekly downloads as of Dec 5, 2026, +16.2% over 90 days.prettier-plugin-shWeekly downloads on npm · Last 90 days428,004downloads / week+16.2% over 90 days0100K200K300K400K500K600KSep 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-sh weekly downloads on npm, last 90 days: 428,004 weekly downloads as of Dec 5, 2026, +16.2% over 90 days.

7/30/90-day growth

prettier-plugin-sh weekly downloads growth on npm: +5.0% over 7 days, -3.3% over 30 days, +16.2% over 90 days.prettier-plugin-shWeekly downloads growth on npm428,004downloads / week now7-day growth+20,418 weekly downloads+5.0%30-day growth-14,557 weekly downloads-3.3%90-day growth+59,535 weekly downloads+16.2%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sh weekly downloads growth on npm: +5.0% over 7 days, -3.3% over 30 days, +16.2% over 90 days.

Ranking history

prettier-plugin-sh npm ranking history: currently #419 (by weekly downloads).prettier-plugin-shnpm ranking · by weekly downloads · Last 90 days#419current rank#385#390#395#400#405#410#415#420#425Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sh npm ranking history: currently #419 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 21, #19 (overall #419)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 1, #4 (overall #4)
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-sh
Date (UTC)Weekly downloadsChange vs. previous
428,004+1.7K
426,284+8.2K
418,129+7.9K
410,237-979
411,216+6.8K
404,464-663
405,127-2.5K
407,586-2.2K
409,806-10.2K
420,029-10.5K
430,555+3.7K
426,885-6.6K
433,458+2.8K
430,658—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-sh 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-sh. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.