# extract-html-class

> Extract all classes from html

Latest version **1.0.1** (published 2017-07-09) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2017-07-09 |
| First published | 2017-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Maintainers | yoshuawuyts |
| Keywords | html, classname, extract, regex |

## Links

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

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-07-09
- 1.0.0 — 2017-07-05

## README

# extract-html-class [![stability][0]][1]
[![npm version][2]][3] [![build status][4]][5]
[![downloads][8]][9] [![js-standard-style][10]][11]

Extract all classes from html

## Usage
```js
var extract = require('extract-html-class')
var assert = require('assert')

var html = `
  <div class="foo bar">
    <p class="bin baz">hello planet</p>
  </div>
`
var expected = [ 'foo', 'bar', 'bin', 'baz' ]
assert.deepEqual(extract(html), expected, 'array was same')
```

## API
### `classes = extract(html)`
Get an array of classes for the given string. Uses a regex so safe to run on
non-html strings too. Returns an empty array if no matches are found.

## License
[MIT](https://tldrlegal.com/license/mit-license)

[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/extract-html-class.svg?style=flat-square
[3]: https://npmjs.org/package/extract-html-class
[4]: https://img.shields.io/travis/yoshuawuyts/extract-html-class/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/extract-html-class
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/extract-html-class/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/extract-html-class
[8]: http://img.shields.io/npm/dm/extract-html-class.svg?style=flat-square
[9]: https://npmjs.org/package/extract-html-class
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

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