npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jdrly/prettier-plugin-hubl

v1.0.6

Published

Prettier plugin for HubL (HubSpot templating language) formatting in HTML, CSS, JSX, and TSX files

Readme

@jdrly/prettier-plugin-hubl

A Prettier plugin for formatting HubL (HubSpot templating language) in HTML, CSS, JSX, and TSX files.

Features

  • One block per line: Separates multiple HubL blocks that are on the same line
  • Whitespace normalization: Cleans up irregular spacing inside blocks
  • Module formatting: Intelligently wraps long {% module %} statements with indented arguments
  • Comma preservation: Preserves commas between arguments if present in the original
  • Safe HTML handling: Skips formatting for HubL control flow inside HTML start tags

Installation

npm install --save-dev @jdrly/prettier-plugin-hubl

Configuration

Add the plugin to your Prettier configuration:

{
  "plugins": ["@jdrly/prettier-plugin-hubl"],
  "printWidth": 80,
  "tabWidth": 2
}

Supported File Types

| Extension | Description | | -------------- | ---------------------------- | | .hubl.html | HubL embedded in HTML | | .hubl.css | HubL embedded in CSS |

Formatting Rules

HubL Block Types

The plugin recognizes three types of HubL blocks:

  • Statements: {% ... %} - Control flow, modules, macros
  • Expressions: {{ ... }} - Output values
  • Comments: {# ... #} - Comments

Module Formatting

Module statements are formatted with special rules:

Single line (if within printWidth):

{% module "HeroSection" path="../components/modules/HeroSection" no_wrapper=True %}

Multi-line (if exceeds printWidth):

{% module "QuoteHeading"
  path="../components/modules/QuoteHeading"
  showBadges=false
  showHeading=false
  showTagline=true
  no_wrapper=True 
%}

Comma Preservation

The plugin preserves commas between arguments only if they were present in the original:

With commas (preserved):

{% module "Name" path="../path", no_wrapper=True %}

Without commas (no commas added):

{% module "Name" path="../path" no_wrapper=True %}

Skip Formatting

The plugin skips formatting for HubL control flow inside HTML start tags to avoid breaking attribute-building patterns:

<!-- This pattern is preserved verbatim -->
<a
  href="{{ blog.absolute_url }}"
  {% if not tag %}class="active"
  {% else %}class="inactive"
  {% endif %}
>Link</a>

Example Transformation

Before:

{% set my_tags = blog_tags('default', 250) %} {% extends "./layouts/base.hubl.html" %} {% block body no_wrapper=True %}
{% module "HeroSection" path="../components/modules/HeroSection" enable, no_wrapper=True %} {% module "QuoteHeading"
path="../components/modules/QuoteHeading" showBadges=false, showHeading=false, showTagline=true, no_wrapper=True %}

After:

{% set my_tags = blog_tags('default', 250) %}
{% extends "./layouts/base.hubl.html" %}
{% block body no_wrapper=True %}
{% module "HeroSection" path="../components/modules/HeroSection" enable, no_wrapper=True %}
{% module "QuoteHeading"
  path="../components/modules/QuoteHeading"
  showBadges=false,
  showHeading=false,
  showTagline=true,
  no_wrapper=True 
%}

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Watch mode
npm run dev

License

MIT