html-classer
Add html classes to every dom node in a fragment.
npm i html-classer
Using
require('html-classer')(fs.readFileSync("wow.html", 'utf8'), {
klass: "tom-jones"
})
Turns
<p>
<b> ok </b>
</p>
Into
<p class='tom-jones'>
<b class='tom-jones'> ok </b>
</p>
API
-
Options
- html classer takes a single key value pair of
klass: 'class-name'
- html classer takes a single key value pair of