# posthtml/posthtml

PostHTML is a tool to transform HTML/XML with JS plugins

Repository: https://github.com/posthtml/posthtml
Canonical: https://ross.abutalabs.com/products/posthtml
Language: JavaScript
License: MIT
License Family: permissive
Topics: posthtml, parser, html, xml, xml-parser, html-parser, transformer
Last push: 2025-10-07T07:17:16+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 45, release rhythm 20, longevity 100
- inputs: {"age_days": 4088, "days_push": 330, "days_rel": 323, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2959, forks 112 (observed 2026-08-28T04:07:32.288564+00:00)

## What it is
PostHTML is a small JavaScript library for transforming HTML/XML via a plugin ecosystem. It provides an HTML parser, a node tree API, and a stringifier, with all transformations performed by plain JS plugin functions.

## Use cases
- transform html with javascript plugins
- parse html into a node tree and manipulate it
- convert custom elements to standard html tags
- process html templates in a build pipeline
- transform html to svg markup
- post-process generated html files

## When to choose
- you need programmatic HTML/XML transformation in Node.js
- you want a lightweight, plugin-based HTML processor similar to PostCSS for CSS
- you are integrating HTML transforms into a Gulp, webpack, or CLI build step

## When to avoid
- you need a full DOM implementation with CSS selectors and events
- you are scraping or parsing untrusted real-world web pages where a robust DOM library like cheerio fits better
- you need a complete static site generator or templating engine out of the box

## Facets
- artifact type: library
- maturity: stable
- function: parser, templating, middleware
- domain: web-development, frontend, parsers, developer-tools
- platform: -
- tags: html-parser, xml-parser, postprocessor, plugin-system, html-transformer, build-pipeline, nodejs, javascript

## Member repositories
- posthtml/posthtml (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.288564+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:32:11.320397+00:00, confidence not recorded.
  - readme: https://github.com/posthtml/posthtml (fetched 2026-08-28T04:07:32.288564+00:00, sha c2d30b45561d)
  - registry_npm: https://registry.npmjs.org/posthtml (fetched 2026-08-29T09:47:50.874305+00:00, sha 173ebd7a01e5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
