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

hsml

v0.5.0

Published

A pug-inspired HTML preprocessor

Readme

Crate Downloads NPM Downloads CI codecov License: MIT Donate: PayPal

HSML - Hyper Short Markup Language

A pug-inspired HTML preprocessor, written in Rust. Less typing, more shipping.

Still young and growing! Some features are cooking. Check out the roadmap below.

What is it?

HSML compiles a short, indentation-based syntax into HTML — think Pug, but leaner:

  • TailwindCSS-friendly — arbitrary values like .bg-[#1da1f2] and lg:[&:nth-child(3)]:hover:underline just work
  • No template engine — HSML is to HTML what TypeScript is to JavaScript: a compile-time transformation, no runtime
  • Rust-powered — fast native CLI + WASM package for browser and bundler use
  • Helpful diagnostics — descriptive errors and warnings with source context, like a good compiler should

Quick taste

doctype html
html
  head
    title My Page
  body
    h1.text-xl.font-bold Hello World
    .card
      img.rounded-full(src="/avatar.jpg" alt="Me")
      p.text-gray-500 Nice to meet you!

Compiles to:

<!DOCTYPE html>
<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <h1 class="text-xl font-bold">Hello World</h1>
    <div class="card">
      <img class="rounded-full" src="/avatar.jpg" alt="Me" />
      <p class="text-gray-500">Nice to meet you!</p>
    </div>
  </body>
</html>

Installation

CLI (via Cargo)

cargo install hsml

WASM (via npm)

npm install -D hsml
# or
pnpm add -D hsml
# or
bun add -D hsml

Usage

CLI

# Compile a single file
hsml compile index.hsml

# Compile to a specific output file
hsml compile index.hsml -o output.html

# Compile all .hsml files in a directory
hsml compile src/

# Check files for errors and warnings without compiling
hsml check src/

# Get diagnostics as JSON (for CI integration)
hsml compile index.hsml --report-format json
hsml check src/ --report-format json

# GitHub Actions annotations
hsml check src/ --report-format github

# GitLab Code Quality report
hsml check src/ --report-format gitlab

# Debug output with timing
hsml compile src/ --debug

# Disable colored output
hsml compile src/ --no-color

Ignore patterns

When compiling or checking a directory, HSML automatically skips:

  • Hidden files and directories (e.g. .git/, .cache/)
  • Built-in ignores: node_modules/, target/, dist/, build/, .hg/, .svn/
  • .gitignore patterns (works even outside git repositories)
  • .hsmlignore patterns (same format as .gitignore)

You can also pass ignore patterns via CLI:

hsml compile src/ --ignore-pattern "vendor/"
hsml check src/ --ignore-pattern "tmp/" --ignore-pattern "generated/"

To re-include a built-in ignored directory, add a negation to .hsmlignore:

# .hsmlignore
!build/

WASM / JavaScript

import { compileContent, compileContentWithDiagnostics } from "hsml";

// Simple compilation
const html = compileContent("h1.title Hello World\n");
// => '<h1 class="title">Hello World</h1>'

// With diagnostics (errors + warnings)
const result = compileContentWithDiagnostics("h1.foo.foo Hello\n");
// => { success: true, html: '...', diagnostics: [{ severity: 'warning', code: 'W002', ... }] }

HSML Syntax

Tags

h1 Hello World
div
  p Some text

Tags default to div when only a class or id is specified:

.container
  .card
    .card-body Hello

Classes

h1.text-red.font-bold Hello

TailwindCSS arbitrary values are fully supported:

.bg-[#1da1f2].lg:[&:nth-child(3)]:hover:underline

IDs

div#app
  h1#title Hello

Attributes

img(src="/photo.jpg" alt="A photo" width="300")
a(href="https://github.com" target="_blank") GitHub
button(disabled) Click me

Multiline attributes work too:

img(
  src="/photo.jpg"
  alt="A photo"
  width="300"
  height="200"
)

Text blocks

Use a trailing . to start a text block:

p.
  This is a multi-line
  text block that preserves
  line breaks.

Comments

// Dev comment (excluded from HTML output)
//! Native comment (rendered as <!-- ... -->)

Doctype

doctype html

Vue / Angular support

HSML supports framework-specific attribute syntax out of the box:

// Vue
button(@click="handleClick" :class="dynamicClass" v-if="show") Click
template(#default)
  p Slot content

// Angular
button([disabled]="isDisabled" (click)="onClick()") Click

Diagnostics

HSML provides helpful error messages with source context:

error[E001]: Tag name must start with an ASCII letter
 --> example.hsml:1:1
  |
1 | 42div Hello
  | ^

And warnings for common mistakes:

warning[W002]: Duplicate class 'foo'
 --> example.hsml:1:12
  |
1 | h1.foo.foo Hello
  |        ^

Error & warning codes

| Code | Description | | ---- | ---------------------------------------- | | E001 | Tag name must start with an ASCII letter | | E002 | Unclosed bracket | | E003 | Unclosed parenthesis | | E004 | Unclosed quote in attribute value | | E005 | Expected quoted attribute value | | E006 | Invalid attribute key | | W001 | Duplicate id (only one per element) | | W002 | Duplicate class | | W003 | Mixed tabs and spaces in indentation | | W004 | Duplicate attribute | | W005 | Void element cannot have content | | W006 | Empty attribute parentheses |

Roadmap

  • [x] Parser with TailwindCSS support
  • [x] HTML compiler
  • [x] CLI with compile command
  • [x] WASM package for npm
  • [x] Diagnostic system with errors and warnings
  • [x] JSON diagnostic output (--report-format json)
  • [x] hsml check — standalone linting command
  • [x] Ignore support (.gitignore, .hsmlignore, --ignore-pattern)
  • [ ] hsml fmt — code formatter
  • [ ] hsml parse — AST output as JSON
  • [x] LSP server with diagnostics and hover
  • [x] GitHub/GitLab CI diagnostic formatters

Contributing

See CONTRIBUTING.md for development setup and commands.

License

MIT — go wild.