Skip to content
PluginStats

prettier-plugin-matryoshka weekly downloads statistics

By yunusemrejs · npm · Prettier plugins

Recursive Prettier plugin for embedded code formatting across nested multi-language blocks.

View on npm Fresh · Dec 6, 2026

prettier-plugin-matryoshka has 7 recorded weekly downloads on npm, a decrease of 12.5% over the past 30 days, ranking #3190 of 3,247 tracked listings.

Weekly downloads
7
Official API · Dec 5, 2026
7-day growth
+40.0%
+2 weekly downloads
30-day growth
-12.5%
-1 weekly downloads
90-day growth
-12.5%
-1 weekly downloads
Rank
#3190
▼ 79 in 7 days

About prettier-plugin-matryoshka

prettier-plugin-matryoshka

CI License: MIT

When Vue, Twig, HTML, CSS, and template tags collide in one file, formatting turns into spaghetti fast. prettier-plugin-matryoshka fixes embedded code formatting with recursive :::parserName blocks and dynamic parser dispatch, so nested multi-language files stay consistent, readable, and production-ready.

Syntax

A block starts with :::parserName and ends with :::endparserName.

:::vue
<template>
  <button @click="count++"> {{ count }} </button>
</template>

:::twig
  {# Twig parser #}
  <div> {{ "hello"|capitalize }} </div>
:::endtwig

<script setup>
  const count = ref(0)
</script>
:::endvue

Features

  • Stack-based recursive parsing for nested blocks.
  • Dynamic parser dispatch from the tag name.
  • Global Prettier option inheritance for inner blocks.
  • Parser-specific overrides via matryoshkaParserOverrides.
  • Optional diagnostic logging with configurable verbosity.
  • Graceful fallback: if an embedded parser is unavailable, the block body is preserved.
  • Syntax safety: mismatched or unclosed tags throw readable parser errors.

:::parserName works with any parser that is available to Prettier (core parser or installed plugin parser).

Install

npm install --save-dev prettier prettier-plugin-matryoshka

Usage

Add the plugin and parser:

{
  "plugins": ["prettier-plugin-matryoshka"],
  "parser": "matryoshka"
}
Parser-specific overrides

matryoshkaParserOverrides is merged on top of global options for each embedded parser.

JSON config (object form):

{
  "tabWidth": 2,
  "matryoshkaParserOverrides": {
    "python": {
      "tabWidth": 4
    }
  }
}

JS config:

/** @type {import("prettier").Config} */
export default {
  tabWidth: 2,
  matryoshkaParserOverrides: {
    python: {
      tabWidth: 4,
    },
  },
};

In this setup, :::python blocks format with tabWidth: 4, while other blocks keep global tabWidth: 2.

Diagnostic logging

Use logging options to troubleshoot parser dispatch and fallback behavior.

{
  "matryoshkaLogLevel": "debug",
  "matryoshkaLogPrefix": "[matryoshka]"
}
  • matryoshkaLogLevel: silent (default), error, warn, info, debug
  • matryoshkaLogPrefix: custom log prefix text

Logs are written to stderr so formatted output on stdout remains clean.

Development

npm install
npm test
npm run test:watch
npm run format:check

Release

For maintainers:

  1. Ensure package.json version and CHANGELOG.md are updated.
  2. Run release checks locally: npm run release:check.
  3. Create and push a version tag:
    • git tag -a v0.1.0 -m "Release v0.1.0"
    • git push origin v0.1.0

On tag push, GitHub Actions runs .github/workflows/release.yml to validate, publish to npm, and create a GitHub Release. Set NPM_TOKEN in repository secrets before tagging.

Open Source Standards

  • Contribution guide: CONTRIBUTING.md
  • Code of conduct: CODE_OF_CONDUCT.md
  • Security policy: SECURITY.md
  • Changelog: CHANGELOG.md
  • License: LICENSE

FAQ / Troubleshooting

How do I format nested code blocks in Prettier?

Use parser: "matryoshka" and wrap each embedded segment with :::parserName and :::endparserName. The plugin parses blocks with a stack and formats inner blocks first, then outer blocks.

How do I fix indentation for Twig inside Vue?

Wrap Twig as its own block inside Vue:

:::vue
<template>...</template>
:::twig
<div>{{ value }}</div>
:::endtwig
:::endvue

The formatter computes shared indentation, formats the child parser, and reapplies indentation to match surrounding code.

Can I format HTML + CSS + JavaScript in one nested file?

Yes. Use nested blocks for each parser. Parser names are dynamic, so any parser available in your Prettier environment can be used.

What if an embedded parser is not installed?

The plugin keeps the original block content and continues, instead of destroying the surrounding file format. Install the missing parser plugin to enable full formatting.

How do I override options for one embedded language only?

Set matryoshkaParserOverrides in .prettierrc:

{
  "tabWidth": 2,
  "matryoshkaParserOverrides": {
    "python": { "tabWidth": 4 }
  }
}
Why is my block not detected?

Tag lines must be exact block markers:

  • Start: :::parserName
  • End: :::endparserName

Extra text on the same line can prevent block detection.

How do I debug parser dispatch and fallback behavior?

Enable logs:

{
  "matryoshkaLogLevel": "debug",
  "matryoshkaLogPrefix": "[matryoshka]"
}

Logs are sent to stderr, so formatted output in stdout remains clean.

Description from the npm listing.

  • prettier
  • prettier-plugin
  • formatter
  • developer-tooling
  • embedded-code-formatting
  • embedded-language-support
  • multi-language-support
  • nested-language-formatting
  • recursive-formatting
  • dynamic-parser-dispatch
  • stack-based-parser
  • template-formatting
  • syntax-highlighting-fix
  • language-injection-formatting
  • format-twig-inside-vue
  • vue
  • twig
  • cms
  • wordpress-tooling
  • drupal-tooling

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-matryoshka weekly downloads on npm, last 90 days: 7 weekly downloads as of Dec 5, 2026, -12.5% over 90 days.prettier-plugin-matryoshkaWeekly downloads on npm · Last 90 days7downloads / week-12.5% over 90 days0246810Sep 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-matryoshka weekly downloads on npm, last 90 days: 7 weekly downloads as of Dec 5, 2026, -12.5% over 90 days.

7/30/90-day growth

prettier-plugin-matryoshka weekly downloads growth on npm: +40.0% over 7 days, -12.5% over 30 days, -12.5% over 90 days.prettier-plugin-matryoshkaWeekly downloads growth on npm7downloads / week now7-day growth+2 weekly downloads+40.0%30-day growth-1 weekly downloads-12.5%90-day growth-1 weekly downloads-12.5%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-matryoshka weekly downloads growth on npm: +40.0% over 7 days, -12.5% over 30 days, -12.5% over 90 days.

Ranking history

prettier-plugin-matryoshka npm ranking history: currently #3190 (by weekly downloads).prettier-plugin-matryoshkanpm ranking · by weekly downloads · Last 90 days#3190current rank#2000#2200#2400#2600#2800#3000#3200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 40 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-matryoshka npm ranking history: currently #3190 (by weekly downloads).

Listing placement

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

Listing placement

Prettier plugins267 listings · 14 pages · page 13, #7 (overall #247)
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-matryoshka
Date (UTC)Weekly downloadsChange vs. previous
70
7-1
8+5
30
3+1
20
2-3
5-2
7+1
60
6-1
70
70
7—

Similar npm Prettier plugins plugins

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