Registry / devops / prettier-plugin-handlebars

prettier-plugin-handlebars

JSON →
library0.0.1jsnpmunverified

Prettier plugin for formatting Handlebars templates, including partials support. Version 0.0.1 is the initial release. It is a lightweight plugin that integrates with Prettier to format Handlebars files using the prettier/handlebars parser. Key differentiators include support for partials, custom delimiters, and seamless integration with Prettier's existing workflows.

npm install prettier-plugin-handlebars
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-HA
P
prettier-plugin-handlebars
devopsjavascriptv0.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import plugin from 'prettier-plugin-handlebars'
const plugin = require('prettier-plugin-handlebars')
Plugin is ESM-only. Use import for Prettier config.
parsers
import { parsers } from 'prettier-plugin-handlebars'
const { parsers } = require('prettier-plugin-handlebars')
Access parsers for custom Prettier configuration.
options
import { options } from 'prettier-plugin-handlebars'
Options object for configuring Handlebars-specific formatting.

Configures Prettier to format .hbs files using the Handlebars plugin.

// .prettierrc { "plugins": ["prettier-plugin-handlebars"], "overrides": [ { "files": "*.hbs", "options": { "parser": "handlebars" } } ] }
Debug
Known issues
breakingPlugin requires Prettier v3 or later due to ESM-only exports.
fix
Upgrade Prettier to v3+.
affects: <0.0.1
gotchaHandlebars expressions inside HTML attributes may not be formatted correctly.
fix
Use alternative formatting or manual review for complex attribute expressions.
affects: *
deprecatedCustom delimiters are not supported in this version.
fix
Only use default {{ }} delimiters.
affects: 0.0.1
Errors
Common errors & fixes
Cannot find module 'prettier-plugin-handlebars'
Plugin not installed or not in node_modules.
fix
Run 'npm install prettier-plugin-handlebars'
Error: Couldn't resolve parser "handlebars"
Plugin not specified in Prettier config plugins array.
fix
Add '"plugins": ["prettier-plugin-handlebars"]' to .prettierrc
TypeError: prettier-plugin-handlebars is not a plugin
Using CommonJS require with ESM-only plugin.
fix
Use import syntax or dynamic import() in Prettier config.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
prettierrequiredpeer dependency required for plugin to function
Agent activity
2 hits · last 30 days
node
2
Resources
prettier-plugin-handlebars — npm install prettier-plugin-handlebars · libregistry