1.0.9 • Published 6 years ago

dom-tree-creator v1.0.9

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

How to use it:

import getDomTree from 'dom-tree-creator'

const domTree = getDomTree((`
  <p class="coso">
    <a>ink here</a>
  </p>
  <hola />
  <ul>
    <li><button></button></li>
    <li><button></button></li>
  </ul>`))

Get the tree:

[
  {
    "parent": "p",
    "children": [
      {
        "parent": "a",
        "children": [],
        "attributes": []
      }
    ],
    "attributes": [
      {
        "attributeName": "class",
        "attributeValue": "coso"
      }
    ]
  },
  {
    "parent": "hola",
    "children": [],
    "attributes": []
  },
  {
    "parent": "ul",
    "children": [
      {
        "parent": "li",
        "children": [
          {
            "parent": "button",
            "children": [],
            "attributes": []
          }
        ],
        "attributes": []
      },
      {
        "parent": "li",
        "children": [
          {
            "parent": "button",
            "children": [],
            "attributes": []
          }
        ],
        "attributes": []
      }
    ],
    "attributes": []
  }
]
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago