parse5-helper

0.10.0 • Public • Published

parse5-helper

Parse5 helper functions

Installation

npm install --save parse5-helper

Sample


const ph = require('parse5-helper');

// Returns node with childNodes
const doc = ph.autoParse('<div>sample</div>');

// Convert branched object into array of nodes
const nodes = ph.getNodes(doc); // Returns an array of nodes

Methods

adoptAttributes

appendChild

autoParse

createCommentNode

createDocument

createDocumentFragment

createElement

detachNode

findAll

findOne

firstNodeByTag

getAttribute

getAttributes

getAttrList

getChildNodes

getClassList

getCommentNodeContent

getDocumentMode

getDocumentTypeNodeName

getDocumentTypeNodePublicId

getDocumentTypeNodeSystemId

getFirstChild

getNamespaceURI

getNodeById

getNodes

getNodesByClass

getNodesByTag

getNodeSourceCodeLocation

getOptions

getParentNode

getTagName

getTemplateContent

getTextNodeContent

getTextNodes

hasClassMatch

insertBefore

insertText

insertTextBefore

isCommentNode

isDocumentHtml

isDocumentTypeNode

isElementNode

isIdMatch

isTagMatch

isTextNode

options_

parse

parseFragment

prependChild

removeAttribute

replaceNode

serialize

setAttribute

setDocumentMode

setDocumentType

setNodeParent

setNodeSourceCodeLocation

setOptions

setTemplateContent

toAttrs

updateNodeSourceCodeLocation

Credit

This project was inspired by the utils package available @ https://www.npmjs.com/package/parse5-utils

Readme

Keywords

Package Sidebar

Install

npm i parse5-helper

Weekly Downloads

2

Version

0.10.0

License

MIT

Unpacked Size

21.9 kB

Total Files

6

Last publish

Collaborators

  • michaeljstutz