html-element
A simple HTMLElement shim on the server.
Last updated 5 years ago by ins0mnia .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install html-element 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.3.1                                ...           latest (5 years ago)

19 Versions

  • 2.3.1                                ...           5 years ago
  • 2.3.0                                ...           6 years ago
  • 2.2.0                                ...           8 years ago
  • 2.1.1                                ...           9 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.5.1                                ...           9 years ago
  • 1.5.0                                ...           9 years ago
  • 1.4.0                                ...           10 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.8                                ...           11 years ago
  • 1.2.7                                ...           11 years ago
  • 1.2.6                                ...           11 years ago
  • 1.2.5                                ...           12 years ago
  • 1.2.4                                ...           12 years ago
  • 1.2.3                                ...           12 years ago
  • 1.2.2                                ...           12 years ago
  • 1.2.0                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
Downloads
Today 0
This Week 0
This Month 19
Last Day 0
Last Week 36
Last Month 18
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |