Socket
Socket
Sign inDemoInstall

html-element

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-element

A simple HTMLElement shim on the server.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

Note: adds "document" to globals.

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

Keywords

FAQs

Package last updated on 18 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc