# classes-manager

> Add, remove, list or check style classes of an element, or group of them, in your DOM.

Latest version **1.1.0** (published 2016-09-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install classes-manager
pnpm add classes-manager
yarn add classes-manager
bun add classes-manager
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-09-15 |
| First published | 2016-08-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Christian MacMillan |
| Maintainers | cmacmillanmarin |
| Keywords | add, remove, classes, class, dom |

## Links

- npm: https://www.npmjs.com/package/classes-manager
- Repository: https://github.com/cmacmillanmarin/classes-manager
- Homepage: https://github.com/cmacmillanmarin/classes-manager#readme
- Issues: https://github.com/cmacmillanmarin/classes-manager/issues
- npm.io page: https://npm.io/package/classes-manager

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-09-15
- 1.0.3 — 2016-09-07
- 1.0.2 — 2016-08-11
- 1.0.1 — 2016-08-11
- 1.0.0 — 2016-08-11

## README

## classes-manager

Add, remove, list or check style classes of an element, or group of them, in your DOM. Implemented with ES2015 and only native js. For a faster performance I recommend passing the element, or elements, via native .querySelector(), or .querySelectorAll(), it is way faster than other libraries like jQuery.

## Install

```bash
$ npm install classes-manager
```

## Usage

```js
import classes from 'classes-manager'
```

## API

### .add(el, class)

Add a `class` to the element/s.

### .remove(el, class)

Remove a `class` from the element/s.

### .has(el, class)

Check if a `class` is present in the element/s. It returns values of T/F.

### .classes(el)

Return an array of classes present in the element.

  ```
  classes(el)
  // => ['active', 'nav']
  ```

## Example

```js
import classes from 'classes-manager'

classes.add(document.querySelector('.existingClass'),'classToAdd')
```

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