A lighter alternative to HTMX and Alpine.js

HMPL.js is a server-oriented, customizable templating language for JavaScript. It lets you fetch HTML from the server, sanitize it with DOMPurify, and drop it directly into your app. Unlike bulky frameworks or DOM-bound utilities, HMPL keeps your client bundle tiny—shaving megabytes off load times—while still giving you the flexibility of JSON5-based configuration.


Customizable requests, safe rendering

Instead of being locked into rigid patterns, HMPL lets you fully customize how your client talks to the server. You can generate thousands of DOM nodes from a single template, keep templates in standalone .hmpl files, and control every request with minimal JavaScript. Every response is sanitized before hitting the DOM, protecting you against XSS by default.


SSR feel, CSR control

Think of it as server-side rendering without the SEO headaches: HMPL behaves like CSR but with all the benefits of SSR-style UI generation. At ~24KB, it’s smaller than Alpine.js and significantly leaner than most alternatives, yet powerful enough for production apps. After a year of trial and error refining syntax and workflows, we’re ready to share HMPL.js with the community—and your feedback will shape what comes next.