Himalaya: HTML to JSON Parser

JSON →
library 1.1.1 ·javascript
verified May 27, 2026

Himalaya is a JavaScript library designed to synchronously parse HTML documents into a structured JSON Abstract Syntax Tree (AST) and to convert that JSON AST back into HTML. Its current stable version is 1.1.1. The library maintains a steady release cadence, with minor releases adding features like source position tracking (v1.1.0) and patch releases addressing bugs, such as issues with malformed closing tags (v1.0.1) or CSS value parsing (v0.2.13). A significant breaking change occurred in v1.0.0, which dropped the older v0 specification in favor of a new, standardized v1 AST format, making the v1 spec the default. Key differentiators include its synchronous operation, robust handling of "weird HTML" edge cases (like unclosed tags, extra closing tags, void/self-closing tags, doctypes, and comments), and its ability to accurately preserve whitespace from the original HTML. It also offers a `stringify` method for converting the JSON AST back to HTML, facilitating round-trip transformations. The parser explicitly does not process the content of `<script>`, `<style>`, and `<template>` tags, treating them as raw text.

total hits 15
actors 7 distinct systems
last hit 4d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1

top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany