html5-utils

1.0.0-beta.6 • Public • Published

HTML5-UTILS

helper functions to parse and manipulate html5

Join the chat at https://gitter.im/aruntk/projects Check out the package on npm https://www.npmjs.com/package/html5-utils

Attribute Helpers

getAttrIndex

.getAttrIndex(node, attributeName)

first index of the attribute inside attr array or -1 if attribute is not set

hasAttr

.hasAttr(node, attributeName)

check if attribute is set

getAttr

.getAttr(node, attributeName)

returns attribute value or null

setAttr

.setAttr(node, attributeName, value)

sets/changes attribute.

removeAttr

.removeAttr(node, attributeName)

TODO

  • Create nodes, fragments, comments and shadows
  • Append, prepend, replace, remove, swap operations
  • Query Selector for nodes. Optional Jquery operations also. like cheerio
  • Operations like innerText and innerHTML.
  • Extract contents of link nodes and create curresponsing tags
  • Change tags
  • Ancestors and children helpers
  • Cleaners and minifiers
  • Change value of desired attribute/s

/html5-utils/

    Package Sidebar

    Install

    npm i html5-utils

    Weekly Downloads

    2

    Version

    1.0.0-beta.6

    License

    MIT

    Last publish

    Collaborators

    • aruntk