# html-element

> A simple HTMLElement shim on the server.

Latest version **2.3.1** (published 2020-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-element
pnpm add html-element
yarn add html-element
bun add html-element
```

## 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 | 2.3.1 |
| Published | 2020-02-05 |
| First published | 2013-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2 |
| Dependencies | 1 |
| Unpacked size | 32.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | ins0mnia |
| Maintainers | ins0mnia, tdumitrescu |
| Keywords | html-element, HTMLElement, element, shim |

## Links

- npm: https://www.npmjs.com/package/html-element
- Repository: https://github.com/1N50MN14/html-element
- Issues: https://github.com/1N50MN14/html-element/issues
- npm.io page: https://npm.io/package/html-element

## Dependencies (1)

- [class-list](https://npm.io/package/class-list.md) ~0.1.1

## 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

- 2.3.1 (latest) — 2020-02-05
- 2.3.0 — 2019-05-22
- 2.2.0 — 2016-12-18
- 2.1.1 — 2016-08-31
- 2.1.0 — 2016-08-27
- 2.0.0 — 2016-08-24
- 1.5.1 — 2016-06-30
- 1.5.0 — 2016-03-07
- 1.4.0 — 2015-06-05
- 1.3.0 — 2014-01-18
- 1.2.8 — 2013-10-17
- 1.2.7 — 2013-10-12
- 1.2.6 — 2013-09-23
- 1.2.5 — 2013-02-28
- 1.2.4 — 2013-02-28
- … 4 more at https://npm.io/package/html-element/versions

## README

# html-element

A simple HTMLElement shim on the server.

This is a partial implementation of HTMLElement, to get client-side templates (such as [hyperscript](https://github.com/dominictarr/hyperscript)) working in node!

The current implementation is fully compatible with [hyperscript](https://github.com/dominictarr/hyperscript).

### Upgrading from v1.x

As of v2.0.0 (Aug 2016), `html-element` no longer affects the global namespace by default. If you currently rely on `require('html-element')` to create globals such as `document` and `Element`, you should instead `require('html-element/global-shim')` when upgrading to v2.

For non-global usage, you can import objects directly from the main package, e.g.:
```javascript
var document = require('html-element').document;
```
or
```javascript
import { Element } from 'html-element';
```

## Supported methods

- createElement(nodeName)
- createTextNode(value)
- appendChild(node)
- replaceChild(node)
- removeChild(node)
- insertBefore(new, existing)
- toString()
- setAttribute(name, value)
- getAttribute(name)
- setProperty(name, value)
- getProperty(name)
- innerHTML()
- outerHTML()
- textContent()
- addEventListener(eventType, listenerFunc)
- removeEventListener(eventType, listenerFunc)
- dispatchEvent(event)

Setters update existing objects, otherwise create anew;

## Properties
- innerHTML
- outerHTML
- textContent
- attribute.value
- attribute.name
- everything else

## TODO / Missing features
- Your PR to make this a more accurate implementation


## License

MIT

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