Skip to content
PluginStats

prettier-plugin-html-template-literals weekly downloads statistics

By sgtpep · npm · Prettier plugins

Formats HTML within tagged template literals in Prettier which is useful for hyperHTML, lit-html, choo, hyperx, nanohtml, snabby, yo-yo, and others.

View on npm Fresh · Dec 6, 2026

prettier-plugin-html-template-literals has 203 recorded weekly downloads on npm, a decrease of 46.3% over the past 30 days, ranking #2492 of 3,247 tracked listings.

Weekly downloads
203
Official API · Dec 5, 2026
7-day growth
+18.0%
+31 weekly downloads
30-day growth
-46.3%
-175 weekly downloads
90-day growth
+8.0%
+15 weekly downloads
Rank
#2492
▼ 87 in 7 days

About prettier-plugin-html-template-literals

prettier-plugin-html-template-literals

Build Status

Formats HTML within tagged template literals in Prettier which is useful for hyperHTML, lit-html, choo, hyperx, nanohtml, snabby, yo-yo, and others. For example:

Input:

html`<div id="foo" class="foo bar baz" data-foo="foo" data-bar="bar" data-baz="baz"><span>Foobar</span></div>`;

Output:

html`
  <div
    id="foo"
    class="foo bar baz"
    data-foo="foo"
    data-bar="bar"
    data-baz="baz"
  >
    <span>Foobar</span>
  </div>
`;

Why

Declaring HTML templates using tagged template literals is a nice alternative to JSX. It relies only on standard ES6+ and doesn't require a transpiling/preprocessing toolset, at least during development. hyperHTML and lit-html are nice lightweight libraries built on this idea and, more than that, provide the React-like experience without the bloat of Virtual DOM. There are also Virtual DOM-based libraries that consume HTML from tagged template literals: choo, hyperx, nanohtml, snabby, yo-yo, and others.

Warning

As HTML tagged template literals get more attention, no doubts Prettier will support them. You can track an open issue for this request. The problem is that the HTML parser within Prettier is not stable yet, and they haven't decided which tags should identify HTML templates. Also, at the moment, there is no API in Prettier to provide additional embedded languages from plugins. There is a feature request for this. This plugin provides a temporary 'hacky' solution until it will be implemented within Prettier. It uses Prettier's JSX parser and formats any tagged template literal (but not regular template literal) if it contains </...> or <.../>. It uses some dirty tricks under the hood, so be warned and report issues/PR.

Usage

Install prettier and prettier-plugin-html-template-literals using yarn:

yarn add prettier prettier-plugin-html-template-literals

Or using npm:

npm install prettier prettier-plugin-html-template-literals
Usage from CLI

prettier-plugin-html-template-literals replaces the prettier executable with its wrapped version. The original prettier executable will be restored if you delete this plugin. Use it as the regular prettier executable:

echo 'html`<div><span>foo</span></div>`' | ./node_modules/.bin/prettier --stdin-filepath=test.js
Usage from API

Unfortunately, this plugin is actually ignored by the API exposed with the prettier module at the moment. Instead of require('prettier').format() you need to use the wrapper module with the same API:

require('prettier-plugin-html-template-literals/prettier').format(
  'html`<div><span>foo</span></div>`',
  { parser: 'babylon' },
);

Limitations

Because of this plugin relies on the JSX parser it has some limitations. Some of them may be addressed in future if it will be possible to find a workaround.

  • Attribute values without quotes are not supported. Raises an exception: <div id=foo>
  • Contents of <style> elements is ignored and not prettified. Style is not formatted: <style>.foo{color:red}</style>
  • It's impossible to reliably eliminate whitespace between adjacent elements: May be wrapped on not to multiple lines: <span></span><span></span>
  • All empty elements are converted to self-closing (void) ones: <div />
  • Whitespace is not preserved within elements sensitive to it like pre or textarea. Contents will be collapsed to a single space: <pre>\n</pre>

Description from the npm listing.

  • choo
  • html
  • hyperhtml
  • hyperx
  • lit-html
  • nanohtml
  • prettier
  • prettier-plugin
  • snabby
  • tagged-template-literal
  • template-literal
  • yo-yo

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-html-template-literals weekly downloads on npm, last 90 days: 203 weekly downloads as of Dec 5, 2026, +8.0% over 90 days.prettier-plugin-html-template-literalsWeekly downloads on npm · Last 90 days203downloads / week+8.0% over 90 days02004006008001KSep 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-html-template-literals weekly downloads on npm, last 90 days: 203 weekly downloads as of Dec 5, 2026, +8.0% over 90 days.

7/30/90-day growth

prettier-plugin-html-template-literals weekly downloads growth on npm: +18.0% over 7 days, -46.3% over 30 days, +8.0% over 90 days.prettier-plugin-html-template-literalsWeekly downloads growth on npm203downloads / week now7-day growth+31 weekly downloads+18.0%30-day growth-175 weekly downloads-46.3%90-day growth+15 weekly downloads+8.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-html-template-literals weekly downloads growth on npm: +18.0% over 7 days, -46.3% over 30 days, +8.0% over 90 days.

Ranking history

prettier-plugin-html-template-literals npm ranking history: currently #2492 (by weekly downloads).prettier-plugin-html-template-literalsnpm ranking · by weekly downloads · Last 90 days#2492current rank#1400#1600#1800#2000#2200#2400#2600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-html-template-literals npm ranking history: currently #2492 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 125, #12 (overall #2,492)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 4, #14 (overall #74)
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-html-template-literals
Date (UTC)Weekly downloadsChange vs. previous
203-1
204-2
206+14
192+43
149-11
160-3
163-9
1720
172-8
180-38
218+35
183+19
164-2
166—

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-html-template-literals. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.