1.0.1 • Published 10 years ago
dom-node-types v1.0.1
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-typesAPI
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_NODEATTRIBUTE_NODETEXT_NODECDATA_SECTION_NODEENTITY_REFERENCE_NODEENTITY_NODEPROCESSING_INSTRUCTION_NODECOMMENT_NODEDOCUMENT_NODEDOCUMENT_TYPE_NODEDOCUMENT_FRAGMENT_NODENOTATION_NODE