# bem-classname-parser

> Parse Block Element Modifier from `block__elem_mod`, `block__elem--mod` etc.

Latest version **1.0.2** (published 2016-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install bem-classname-parser
pnpm add bem-classname-parser
yarn add bem-classname-parser
bun add bem-classname-parser
```

## 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.2 |
| Published | 2016-04-24 |
| First published | 2015-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vladimir Rodkin |
| Maintainers | vovanr |
| Keywords | bem, block, class, classname, element, modifier, parser, utility |

## Links

- npm: https://www.npmjs.com/package/bem-classname-parser
- Repository: https://github.com/vovanr/bem-classname-parser
- Homepage: https://github.com/vovanr/bem-classname-parser#readme
- Issues: https://github.com/vovanr/bem-classname-parser/issues
- npm.io page: https://npm.io/package/bem-classname-parser

## 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.0.2 (latest) — 2016-04-24
- 1.0.1 — 2016-04-20
- 1.0.0 — 2016-01-07
- 0.3.0 — 2016-01-07
- 0.2.0 — 2016-01-04
- 0.1.2 — 2015-12-28
- 0.1.1 — 2015-12-28
- 0.1.0 — 2015-12-27

## README

# bem-classname-parser

[![Commitizen friendly][commitizen-image]][commitizen-url]
[![XO code style][codestyle-image]][codestyle-url]

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coveralls Status][coveralls-image]][coveralls-url]
[![Dependency Status][depstat-image]][depstat-url]
[![DevDependency Status][depstat-dev-image]][depstat-dev-url]

> Parse Block Element Modifier from `block__elem_mod`, `block__elem--mod` etc.

Demo: [vovanr.github.io/bem-classname-parser][demo]

## Install

```
npm install --save bem-classname-parser
```

## Usage

```js
var bemClassnameParser = require('bem-classname-parser');

bemClassnameParser.parse('block__elem_mod-name_mod-value');
// {
//   block: {
//     name: 'block'
//   },
//   elem: {
//     name: 'elem',
//     mod: {
//       name: 'mod-name',
//       val: 'mod-value',
//       sep: '_'
//     }
//   }
// }

bemClassnameParser.parse('block--mod');
// {
//   block: {
//     name: 'block',
//     mod: {
//       name: 'mod',
//       val: null,
//       sep: '--'
//     }
//   }
// }

bemClassnameParser.parse('');
// {}
```

## License

MIT © [Vladimir Rodkin](https://github.com/VovanR)

[demo]: https://vovanr.github.io/bem-classname-parser

[commitizen-url]: http://commitizen.github.io/cz-cli/
[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square

[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square

[npm-url]: https://npmjs.org/package/bem-classname-parser
[npm-image]: http://img.shields.io/npm/v/bem-classname-parser.svg?style=flat-square

[travis-url]: https://travis-ci.org/VovanR/bem-classname-parser
[travis-image]: http://img.shields.io/travis/VovanR/bem-classname-parser.svg?style=flat-square

[coveralls-url]: https://coveralls.io/r/VovanR/bem-classname-parser
[coveralls-image]: http://img.shields.io/coveralls/VovanR/bem-classname-parser.svg?style=flat-square

[depstat-url]: https://david-dm.org/VovanR/bem-classname-parser
[depstat-image]: https://david-dm.org/VovanR/bem-classname-parser.svg?style=flat-square

[depstat-dev-url]: https://david-dm.org/VovanR/bem-classname-parser
[depstat-dev-image]: https://david-dm.org/VovanR/bem-classname-parser/dev-status.svg?style=flat-square

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