simple tree data structure for html source
npm install htmltreeVery simple xml/html -> syntax tree converter. Useful for further mangling your html source.
``javascript
var htmltree = require('htmltree');
htmltree('
', function(err, doc) {Each node entry is an object with the following form.
`javascript
// node
[
{
type: 'tag' | 'text' | 'comment',
name: 'html', // set for 'tag' nodes
attributes: {
},
children: [
{
tag: body,
attributes: {
onclick: 'foo'
}
},
...
],
// true if the tag node is a void element no body
void: boolean
}
]
``MIT