dom-node-types
v1.0.1
Published
Exports the name/value pairs of DOM Node types
Downloads
1,933
Readme
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