# mahabhuta

> Server-side DOM processing for HTML documents using jQuery-like API

Latest version **0.9.2** (published 2026-06-24) · 0 weekly downloads

## Install

```sh
npm install mahabhuta
pnpm add mahabhuta
yarn add mahabhuta
bun add mahabhuta
```

Provides the command `mahabhuta`.

## Health

**Score 50/100 (C)** — status: active.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.9.2 |
| Published | 2026-06-24 |
| First published | 2015-02-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=24.x |
| Dependencies | 2 |
| Unpacked size | 213.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Herron |
| Maintainers | reikiman |
| Keywords | htmlparser, jquery, selector, parser, html, DOM, template, cheerio, akashacms |

## Links

- npm: https://www.npmjs.com/package/mahabhuta
- Repository: https://github.com/akashacms/mahabhuta
- Issues: https://github.com/akashacms/mahabhuta/issues
- npm.io page: https://npm.io/package/mahabhuta

## Dependencies (2)

- [cheerio](https://npm.io/package/cheerio.md) ^1.2.x
- [commander](https://npm.io/package/commander.md) ^15.x

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.9.2 (latest) — 2026-06-24
- 0.4.2 (stable) — 2015-05-07
- 0.9.1 — 2026-04-11
- 0.9.0 — 2025-06-24
- 0.8.5 — 2024-11-06
- 0.8.4 — 2024-03-08
- 0.8.3 — 2022-07-24
- 0.8.2 — 2022-07-23
- 0.8.1 — 2022-07-22
- 0.8.0 — 2022-02-01
- 0.7.9 — 2021-12-09
- 0.7.8 — 2021-12-04
- 0.7.7 — 2021-12-02
- 0.7.6 — 2021-12-02
- 0.7.5 — 2021-12-02
- … 21 more at https://npm.io/package/mahabhuta/versions

## README

# Mahabhuta
jQuery-like document processing engine for server-side DOM processing on Node.js

This is a wrapper around Cheerio to perform a series of jQuery-like operations on an HTML document.  It allows one to package a set of reusable, discrete, DOM-manipulations that run server-side on Node.js.

The name comes because Mahabhuta was developed as part of AkashaCMS.  Where Akasha is the Sanskrit word for the primordial element from which the universe was constructed, Mahabhuta is the collective name for all five elements (earth, air, fire, water, spiritual-essence-space).  Because Mahabhuta focuses on processing HTML elements the name fits.

Mahabhuta uses the [Cheerio](https://www.npmjs.com/package/cheerio) library for its jQuery-like API.  It doesn't support the full jQuery API, but a subset that the Cheerio team feels is useful.  Mahabhuta is used in [AkashaCMS](http://akashacms.com/) to provide DOM manipulation during page rendering.

## Purpose

Generally speaking, what's done with Mahabhuta is to either invent special tags (e.g. `<youtube-video-embed>`), and provide a function to process that tag, or to do special DOM manipulation.

Consider a page like this:

```
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Use the .htaccess and remove these lines to avoid edge case issues. More info: h5bp.com/i/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<ak-page-title/>
<ak-header-metatags/>
<ak-sitemapxml/>
<ak-siteverification/>
<ak-stylesheets/>
<ak-headerJavaScript/>
</head>
<body>
<ak-navigation-bar/>
<ak-insert-content/>
<!-- JavaScript at the bottom for fast page loading -->
<ak-footerJavaScript/>
<ak-google-analytics/>
</body>
</html>
```

What Mahabhuta does is give you the ability to process special tags like these, converting each into a corresponding HTML snippet.  The result is a fully fleshed out functional page suitable for display in a browser.

Another plausible use is to search for all `img` tags with a special class, and either add (or don't add) the image to `og:image` meta tags.

```
<img class="... ogshow ..." src="..."/>
```

This tag might be detected, and then added to the page header as an `og:image` tag so that social network sites can detect images to show when the page is shared.

## Installation

Add `mahabhuta` to your `package.json` and type:

```
$ npm install
```

Or simply type

```
$ npm install mahabhuta
```

---
_Source: https://npm.io/package/mahabhuta · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
