# mudom

> µDOM utilities

Latest version **1.0.11** (published 2024-04-03) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2024-04-03 |
| First published | 2020-12-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 206.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | loveencounterflow |
| Keywords | dom, jquery, µdom, frontend |

## Links

- npm: https://www.npmjs.com/package/mudom
- Repository: https://github.com/loveencounterflow/mudom
- Homepage: https://github.com/loveencounterflow/mudom#readme
- Issues: https://github.com/loveencounterflow/mudom/issues
- npm.io page: https://npm.io/package/mudom

## Dependencies (2)

- [intertype](https://npm.io/package/intertype.md) ^7.6.3
- [chrome-a11y-caret-browsing-extension](https://npm.io/package/chrome-a11y-caret-browsing-extension.md) ^1.0.2

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2024-04-03
- 1.0.10 — 2023-08-16
- 1.0.9 — 2023-08-08
- 1.0.8 — 2023-08-07
- 1.0.7 — 2023-08-03
- 1.0.6 — 2023-08-02
- 1.0.5 — 2023-08-01
- 1.0.4 — 2023-08-01
- 1.0.3 — 2023-08-01
- 1.0.2 — 2023-08-01
- 1.0.1 — 2023-07-31
- 1.0.0 — 2023-07-31
- 0.3.1 — 2023-07-26
- 0.3.0 — 2023-07-26
- 0.2.3 — 2021-01-10
- … 10 more at https://npm.io/package/mudom/versions

## README

# µDOM



<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [What it Is](#what-it-is)
- [Installation](#installation)
- [API](#api)
  - [DOM](#dom)
  - [TEXT](#text)
  - [KB](#kb)
- [How to Use It](#how-to-use-it)
- [To Do](#to-do)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->


## What it Is

utilities to handle DOM-related tasks

## Installation

```bash
npm install -g mudom
browserify -r mudom -o app/static/browserified/mudom.js
```

## API

### DOM
### TEXT



### KB

Demo on https://loveencounterflow.github.io/hengist/dev/mudom/static/index.html

## How to Use It

* runs in the browser using [`browserify`](https://github.com/browserify/browserify)

## To Do

* **[–]** absorb `µ.keyboard-modifier-emitter.js` (svelte app2)
* **[–]** absorb `src/components/Toolbox/index.svelte#µ_DOM_detect_doublekey_events()`
* **[–]** documentation
* **[–]** offer browserified builds
* **[–]** allow lists of elements with event binding
* **[–]** include things like `computedStyleMap()`, `attributeStyleMap`, `computedStyleMap()` from CSS Houdini
  * https://www.smashingmagazine.com/2020/03/practical-overview-css-houdini/
  * https://web.dev/houdini-how/?utm_campaign=CSS%2BLayout%2BNews&utm_medium=web&utm_source=CSS_Layout_News_281
  * https://web.dev/css-props-and-vals/
  * https://houdini.how/
* **[–]** export classes `Dom`, `Text`, &c.
* **[–]** this should work but doesn't:

  ```coffee
  sub_document  = iframe.contentDocument
  first_tracker = µ.DOM.select_first_from sub_document, '.tracker'
  ```

  Error message is `not a valid delement: HTMLDocument{...`; suspicion is that `HTMLDocument` should be
  accepted as a (DOM) `element`

  **Note** the real problem is not the test `x instanceof Element`, the problem lies in the realm-crossing
  nature of the `<iframe>` element
  * solution *might* be to just check for presence of relevant API (like `element.querySelectorAll?`)

* **[–]** allow to instantiate with virtual DOM object so µDOM can be used outside the browser
* **[–]** integrate XPath &c from playlist µDOM2
* **[–]** remove `µ.DOM.select_*_from()` methods; instead allow `µ.DOM.select_first()`, `µ.DOM.select_all()`
  to take one or two parameters
* **[–]** ??? allow to pass in `document` on creation as it can differ from main document within iframes
* **[–]** don't reference `µ` from with libraries, use private ref to avoid name collisions
* **[–]** move `loupe.js` to `deps`
* **[–]** integrate method to monitor all events in document or on given element as discussed in
  https://stackoverflow.com/a/72945018:

  ```js
  for (const key in document) if (key.startsWith('on')) document.addEventListener(key.slice(2), console.log);
  ```

  ```js
  // https://stackoverflow.com/a/72945018/319266
  function monitorEvents(element) {
    for (const key in element) {
      if (key.startsWith('on')) {
        element.addEventListener(key.slice(2), console.log);
      }
    }
  }
  ```

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