1.0.1 • Published 8 years ago

dom-node-types v1.0.1

Weekly downloads
72
License
Apache-2.0
Repository
github
Last release
8 years ago

dom-node-types

This module just exports the name/value pairs of DOM Node types. It's trivial, but I find myself needing it regularly and including a dependency on a complete DOM implementation is overkill. I got tired of pasting this around, so it's here.

Installation

npm install dom-node-types

API

ES6:

import { ELEMENT_NODE, TEXT_NODE } from 'dom-node-types';
// or
import * as nodeTypes from 'dom-node-types';

In olden days:

var ELEMENT_NODE = require('dom-node-types').ELEMENT_NODE;
// or
var nodeTypes - require('dom-node-types');

Types

The available types are:

  • ELEMENT_NODE
  • ATTRIBUTE_NODE
  • TEXT_NODE
  • CDATA_SECTION_NODE
  • ENTITY_REFERENCE_NODE
  • ENTITY_NODE
  • PROCESSING_INSTRUCTION_NODE
  • COMMENT_NODE
  • DOCUMENT_NODE
  • DOCUMENT_TYPE_NODE
  • DOCUMENT_FRAGMENT_NODE
  • NOTATION_NODE