MCPcopy Index your code
hub / github.com/1N50MN14/html-element

github.com/1N50MN14/html-element @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
17 symbols 28 edges 5 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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) working in node!

The current implementation is fully compatible with 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.:

var document = require('html-element').document;

or

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()

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

Core symbols most depended-on inside this repo

clean
called by 23
test/index.js
escapeHTML
called by 5
index.js
defineParentNode
called by 4
index.js
_stringify
called by 2
index.js
escapeAttribute
called by 2
index.js
_dataify
called by 1
index.js
_propertify
called by 1
index.js
_shouldOutputProp
called by 1
index.js

Shape

Function 17

Languages

TypeScript100%

Modules by API surface

index.js14 symbols
html-attributes.js2 symbols
test/index.js1 symbols

For agents

$ claude mcp add html-element \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact