# html-class-prefixer

> prefix class names and/or ids in html markup

Latest version **0.0.2** (published 2016-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-class-prefixer
pnpm add html-class-prefixer
yarn add html-class-prefixer
bun add html-class-prefixer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-04-18 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Layton Whiteley |
| Maintainers | lwhiteley |
| Keywords | prefixer, html, class, classnames, id, ids, processor, htmltree, html-class-prefixer |

## Links

- npm: https://www.npmjs.com/package/html-class-prefixer
- Repository: https://github.com/medullan/html-prefixer
- Homepage: https://github.com/medullan/html-prefixer#readme
- Issues: https://github.com/medullan/html-prefixer/issues
- npm.io page: https://npm.io/package/html-class-prefixer

## Dependencies (5)

- [q](https://npm.io/package/q.md) ^1.4.1
- [lodash](https://npm.io/package/lodash.md) ^4.11.1
- [deasync](https://npm.io/package/deasync.md) ^0.1.4
- [htmltree](https://npm.io/package/htmltree.md) 0.0.4
- [htmltree-stringify](https://npm.io/package/htmltree-stringify.md) ^1.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-04-18
- 0.0.1 — 2016-04-18

## README

html-class-prefixer
============
prefix class names and IDs (optionally) in html strings

how to use

### Async
```js
var prefixer = require('html-class-prefixer')

var html = '<div id="container"><span onclick=foo class="sdsd test-texg test"></span></div>';
prefixer(html,
          {prefix:'test-', ignore:['test'], prefixIds: true})
  .then(function(val){
    console.log(val)
    // => <div id="test-container"><span onclick=foo class="sdsd test-texg test"></span></div>
  })
  .fail(function(err){
    console.log(err)
    // = > Error
  })

```

### sync
```js
var prefixer = require('html-class-prefixer')

var html = '<div id="container"><span onclick=foo class="sdsd test-texg test"></span></div>';
var result = prefixer.sync(html, {prefix:'test-', ignore:['test'], prefixIds: true})
// if result is string => successful
// if result is object => Error

```

Notes:
- pull requests are welcome
- better docs to come

---
_Source: https://npm.io/package/html-class-prefixer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
