Skip to content
PluginStats

prettier-plugin-ejs-safe weekly downloads statistics

By Vajkis · npm · Prettier plugins

Prettier plugin for EJS templates — formats HTML, preserves all EJS tags untouched

View on npm Fresh · Oct 18, 2026

prettier-plugin-ejs-safe has 4 recorded weekly downloads on npm, a decrease of 71.4% over the past 30 days, ranking #2207 of 2,322 tracked listings.

Weekly downloads
4
Official API · Oct 18, 2026
7-day growth
+300%
+3 weekly downloads
30-day growth
-71.4%
-10 weekly downloads
90-day growth
-69.2%
-9 weekly downloads
Rank
#2207
Among tracked npm listings

About prettier-plugin-ejs-safe

prettier-plugin-ejs-safe

Prettier plugin for EJS templates — formats the HTML structure while completely preserving all EJS tags untouched.

The problem

The prettier-plugin-ejs breaks EJS tags because it treats their content as HTML and reformats it without any special handling.

The solution

Before formatting, this plugin extracts all EJS tags and replaces them with safe placeholders. After HTML formatting, it restores the original tags.

Original           Placeholder             After formatting        Restored
─────────          ─────────               ─────────               ─────────
<% if (x) { %>  →  <!-- EJSBLOCK_0 -->  →  <!-- EJSBLOCK_0 -->  →  <% if (x) { %>
<%= name %>     →  EJSINLINE_1          →  EJSINLINE_1          →  <%= name %>

Supported EJS tag types

TagDescription
<% code %>Scriptlet (control flow)
<%= expr %>HTML-escaped output
<%- expr %>Unescaped output
<%# comment %>Comment (no output)
<%_ code %>Whitespace-slurping scriptlet
<% code -%>Trim newline after tag
<% code _%>Whitespace slurp after tag

Head/foot partials — ignoreTags

EJS projects are often split into a "head" partial that opens shell tags (<html>, <body>, ...) and a "foot" partial that closes them. Each partial is invalid HTML on its own: Prettier's HTML parser either silently inserts the missing closing tag (unclosed open tag) or throws a parse error (closing tag with no matching open).

ignoreTags removes specific tag names from HTML parsing entirely — their open/close tags pass through untouched, exactly as written, with no auto-closing and no validation.

ValueEffect
["none"] (default)No tags ignored — normal HTML parsing.
["all"]Every tag is left untouched (no structural formatting at all).
["html", "body"]Only the listed tag names are left untouched.
// head.prettierrc — for files that open shell tags
{
  "plugins": ["..."],
  "ignoreTags": ["html", "body"]
}

Ignored tags still count toward indentation — their children are indented as if the tag were really there, even though it's never parsed as one. This is computed per file from that file's own ignored tags only: head.ejs only knows it opens <html>/<body>, and foot.ejs only knows it closes them, but both land on the same indentation because each is shifted so its content never goes above column 0.

<!-- head.ejs -->
<html lang="en">
  <head>
    <title><%= title %></title>
  </head>
  <body>

    <!-- foot.ejs -->
  </body>
</html>

Any tag not listed (like <div> above) still needs to be balanced within that same file — list every tag that spans across your head/foot split, not just html/body.

Team setup

Run once on a new machine. The script installs the plugin globally, resolves the correct plugin path for that machine, and writes ~/.prettierrc automatically.

The scripts aren't published with the npm package — download them from the latest release:

Windows:

  1. Download setup.bat
  2. Double-click it to run — no terminal needed.

Mac / Linux:

  1. Download setup.sh
  2. Run:
    chmod +x setup.sh && ./setup.sh
    

After running, add to VS Code User Settings (Ctrl+Shift+P → Open User Settings JSON):

{
  "prettier.configPath": "C:\\Users\\YourName\\.prettierrc",
  "prettier.resolveGlobalModules": true,
  "[ejs]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

The exact prettier.configPath value is printed by the setup script after it runs.

What the setup script does

  1. Installs prettier-plugin-ejs-safe globally — prettier is included as a dependency, no separate install needed
  2. Finds the plugin path on this machine using npm root -g
  3. Writes ~/.prettierrc with the absolute plugin path

CLI / CI usage

prettier --config ~/.prettierrc --write "**/*.ejs"

Example

Before:

<% if (users.length > 0) { %>
<ul>
  <% users.forEach(function(user){ %>
  <li class="<%= user.role %>"><%= user.name %></li>
  <% }) %>
</ul>
<% } %>

After:

<% if (users.length > 0) { %>
<ul>
  <% users.forEach(function(user){ %>
  <li class="<%= user.role %>"><%= user.name %></li>
  <% }) %>
</ul>
<% } %>

EJS tags unchanged, HTML formatted.

Description from the npm listing.

  • prettier
  • prettier-plugin
  • ejs
  • express
  • template
  • html

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-ejs-safe weekly downloads on npm, last 90 days: 4 weekly downloads as of Oct 18, 2026, -69.2% over 90 days.prettier-plugin-ejs-safeWeekly downloads on npm · Last 90 days4downloads / week-69.2% over 90 days05101520253035Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-ejs-safe weekly downloads on npm, last 90 days: 4 weekly downloads as of Oct 18, 2026, -69.2% over 90 days.

7/30/90-day growth

prettier-plugin-ejs-safe weekly downloads growth on npm: +300% over 7 days, -71.4% over 30 days, -69.2% over 90 days.prettier-plugin-ejs-safeWeekly downloads growth on npm4downloads / week now7-day growth+3 weekly downloads+300%30-day growth-10 weekly downloads-71.4%90-day growth-9 weekly downloads-69.2%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-ejs-safe weekly downloads growth on npm: +300% over 7 days, -71.4% over 30 days, -69.2% over 90 days.

Ranking history

prettier-plugin-ejs-safe npm ranking history: currently #2207 (by weekly downloads).prettier-plugin-ejs-safenpm ranking · by weekly downloads · Last 90 days#2207current rank#2185#2190#2195#2200#2205#2210Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-ejs-safe npm ranking history: currently #2207 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 111, #11 (overall #2,211)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 9, #15 (overall #175)
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 (122)
Recent weekly downloads observations for prettier-plugin-ejs-safe
Date (UTC)Weekly downloadsChange vs. previous
4+3
1-1
2+1
10
10
10
10
10
10
1-1
20
20
2-7
9—

Similar npm Prettier plugins plugins

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