https://github.com/samccone/html-classer
add a class name to every node in a html fragment
https://github.com/samccone/html-classer
Last synced: 2 months ago
JSON representation
add a class name to every node in a html fragment
- Host: GitHub
- URL: https://github.com/samccone/html-classer
- Owner: samccone
- Created: 2014-08-11T18:08:43.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-19T14:39:40.000Z (almost 12 years ago)
- Last Synced: 2025-07-16T00:48:48.157Z (12 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# html-classer
[](https://travis-ci.org/samccone/html-classer)
Add html classes to every dom node in a fragment.
npm i html-classer
### Using
```js
require('html-classer')(fs.readFileSync("wow.html", 'utf8'), {
klass: "tom-jones"
})
```
> Turns
```html
ok
```
**Into**
```html
ok
```
### API
* Options
* html classer takes a single key value pair of `klass: 'class-name'`