Skip to content
PluginStats

@poliklot/prettier-plugin-handlebars weekly downloads statistics

By poliklot (3 listings) · npm · Prettier plugins

Prettier plugin for classic Handlebars (.hbs)

View on npm Fresh · Dec 6, 2026

@poliklot/prettier-plugin-handlebars has 1,315 recorded weekly downloads on npm, a decrease of 63.0% over the past 30 days, ranking #2002 of 3,247 tracked listings.

Weekly downloads
1,315
Official API · Dec 5, 2026
7-day growth
+48.9%
+432 weekly downloads
30-day growth
-63.0%
-2.2K weekly downloads
90-day growth
+61.5%
+501 weekly downloads
Rank
#2002
▲ 23 in 7 days

About @poliklot/prettier-plugin-handlebars

@poliklot/prettier-plugin-handlebars

npm version

Prettier plugin for classic Handlebars templates with mixed HTML markup.

It formats .hbs / .handlebars files used in HTML-heavy Handlebars projects, with a focus on stable, idempotent output and preserving classic Handlebars semantics.

Install

npm install --save-dev prettier @poliklot/prettier-plugin-handlebars

Quick Start

Recommended config:

/** @type {import("prettier").Config} */
module.exports = {
  plugins: ["@poliklot/prettier-plugin-handlebars"],
  overrides: [
    {
      files: ["*.hbs", "*.handlebars"],
      options: {
        parser: "handlebars",
      },
    },
  ],
};

The explicit override keeps .hbs files on this plugin even in Prettier versions that also know about other Handlebars-like parsers.

Configuration Patterns

1. Minimal plugin setup

Use this only when you have verified that your Prettier version and editor resolve .hbs files to this plugin. The explicit override below is safer for shared projects.

/** @type {import("prettier").Config} */
module.exports = {
  plugins: ["@poliklot/prettier-plugin-handlebars"],
};
2. Explicit Handlebars override

Use this when you want stable format-on-save behavior in editors, or when your project mixes multiple template types.

/** @type {import("prettier").Config} */
module.exports = {
  plugins: ["@poliklot/prettier-plugin-handlebars"],
  overrides: [
    {
      files: ["*.hbs", "*.handlebars"],
      options: {
        parser: "handlebars",
      },
    },
  ],
};
3. Explicit Handlebars override with project style

Normal Prettier options still work and often matter a lot for .hbs.

/** @type {import("prettier").Config} */
module.exports = {
  plugins: ["@poliklot/prettier-plugin-handlebars"],
  overrides: [
    {
      files: ["*.hbs", "*.handlebars"],
      options: {
        parser: "handlebars",
        printWidth: 120,
        useTabs: true,
        tabWidth: 4,
        singleQuote: true,
        htmlWhitespaceSensitivity: "ignore",
      },
    },
  ],
};
4. Local plugin path during dogfooding

Useful when you are testing the plugin from a neighboring repository before publishing a new npm version.

/** @type {import("prettier").Config} */
module.exports = {
  plugins: ["../prettier-plugin-handlebars/dist/plugin.js"],
  overrides: [
    {
      files: ["*.hbs", "*.handlebars"],
      options: {
        parser: "handlebars",
      },
    },
  ],
};
5. JSON config
{
  "plugins": ["@poliklot/prettier-plugin-handlebars"],
  "overrides": [
    {
      "files": ["*.hbs", "*.handlebars"],
      "options": {
        "parser": "handlebars",
        "printWidth": 120,
        "useTabs": true,
        "tabWidth": 4
      }
    }
  ]
}

CLI

Published package:

npx prettier --write "src/**/*.{hbs,handlebars}" --plugin @poliklot/prettier-plugin-handlebars --parser handlebars

Local plugin build:

npx prettier --write "src/**/*.{hbs,handlebars}" --plugin ../prettier-plugin-handlebars/dist/plugin.js --parser handlebars

Project Setup Audit

The package also ships a small setup helper:

npx @poliklot/prettier-plugin-handlebars init

By default this is a dry run. It reports whether the project has:

  • local prettier and @poliklot/prettier-plugin-handlebars dependencies;
  • a Prettier config that loads the plugin;
  • an explicit *.hbs / *.handlebars override with parser: "handlebars";
  • .prettierignore patterns that skip Handlebars files.

Apply supported JSON config changes with:

npx @poliklot/prettier-plugin-handlebars init --write

Use it in CI or local checks with:

npx @poliklot/prettier-plugin-handlebars init --check

The helper can create or update .prettierrc, .prettierrc.json, and the prettier object in package.json. JavaScript, JSON5, YAML, and TOML configs are detected but not rewritten automatically; the command prints the manual action instead.

API

const prettier = require("prettier");
const plugin = require("@poliklot/prettier-plugin-handlebars");

async function run(source) {
  return prettier.format(source, {
    filepath: "template.hbs",
    parser: "handlebars",
    plugins: [plugin],
  });
}

Plugin Options

dataAttributeOrder

Custom ordering override for data-* attributes.

DefaultCLI OverrideAPI Override
[]--data-attribute-order <value>dataAttributeOrder: string[]
{
  "plugins": ["@poliklot/prettier-plugin-handlebars"],
  "dataAttributeOrder": ["data-testid", "data-state", "data-track"]
}
maxEmptyLines

Maximum number of consecutive blank lines preserved between nodes.

DefaultCLI OverrideAPI Override
1--max-empty-lines <int>maxEmptyLines: number
{
  "plugins": ["@poliklot/prettier-plugin-handlebars"],
  "maxEmptyLines": 1
}
classAttributeSameLine

Keep the first and last tokens of multiline conditional class attributes glued to their surrounding quotes.

DefaultCLI OverrideAPI Override
false--class-attribute-same-lineclassAttributeSameLine: boolean
{
  "plugins": ["@poliklot/prettier-plugin-handlebars"],
  "classAttributeSameLine": true
}
classAttributeLayout

Control whether class attribute values may use multiple physical lines. The default auto mode preserves the existing formatting rules. Use single-line to keep static and conditional class values on one line; the surrounding HTML tag may still wrap.

DefaultCLI OverrideAPI Override
"auto"--class-attribute-layout <auto|single-line>classAttributeLayout: "auto" | "single-line"

Description from the npm listing.

  • prettier
  • prettier-plugin
  • handlebars
  • hbs
  • html
  • formatter

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

@poliklot/prettier-plugin-handlebars weekly downloads on npm, last 90 days: 1,315 weekly downloads as of Dec 5, 2026, +61.5% over 90 days.@poliklot/prettier-plugin-handlebarsWeekly downloads on npm · Last 90 days1,315downloads / week+61.5% over 90 days01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@poliklot/prettier-plugin-handlebars weekly downloads on npm, last 90 days: 1,315 weekly downloads as of Dec 5, 2026, +61.5% over 90 days.

7/30/90-day growth

@poliklot/prettier-plugin-handlebars weekly downloads growth on npm: +48.9% over 7 days, -63.0% over 30 days, +61.5% over 90 days.@poliklot/prettier-plugin-handlebarsWeekly downloads growth on npm1,315downloads / week now7-day growth+432 weekly downloads+48.9%30-day growth-2,241 weekly downloads-63.0%90-day growth+501 weekly downloads+61.5%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@poliklot/prettier-plugin-handlebars weekly downloads growth on npm: +48.9% over 7 days, -63.0% over 30 days, +61.5% over 90 days.

Ranking history

@poliklot/prettier-plugin-handlebars npm ranking history: currently #2002 (by weekly downloads).@poliklot/prettier-plugin-handlebarsnpm ranking · by weekly downloads · Last 90 days#2002current rank#1200#1400#1600#1800#2000#2200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@poliklot/prettier-plugin-handlebars npm ranking history: currently #2002 (by weekly downloads).

Listing placement

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

Listing placement

Prettier plugins267 listings · 14 pages · page 2, #18 (overall #38)
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 @poliklot/prettier-plugin-handlebars
Date (UTC)Weekly downloadsChange vs. previous
1,315+93
1,2220
1,222+363
859+215
644-145
789+56
733-150
8830
883-64
947-144
1,091-1K
2,120-444
2,564-908
3,472—

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/@poliklot/prettier-plugin-handlebars. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.