deep-child-element-count
Like ParentNode.childElementCount
but counting all the nested children too.
Example:
const deepChildElementCount = require('deep-child-element-count')
var container = document.createElement('div')
var firstChild = document.createElement('div')
container.appendChild(firstChild)
var secondChild = document.createElement('div')
var containedChild = document.createElement('div')
secondChild.appendChild(containedChild)
container.appendChild(secondChild)
console.log(container.childElementCount)
console.log(deepChildElementCount(container))