Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/floatdrop/parse-bem-identifier

Parse B__E_M identifier
https://github.com/floatdrop/parse-bem-identifier

Last synced: about 1 month ago
JSON representation

Parse B__E_M identifier

Awesome Lists containing this project

README

        

# parse-bem-identifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

Parsing B__E_M identifier.

You can learn about identifier structure from [tests](https://github.com/floatdrop/parse-bem-identifier/blob/master/test/index.js).

## Disclaimer

Use [`bem-naming`](https://github.com/bem/bem-naming)

## API

### parseBemIdentifier(pattern, [options])

Parses `string` as BEM identifier and returns object, that contains:

* `block`
* `mod`
* `modVal`
* `elem`
* `elemMod`
* `elemVal`

#### options

##### short
Type: `Boolean`
Default: `false`

If true, then `elemMod` will be stored in `mod`, `modVal` and `elemVal` will be stored in `val`.

# License
MIT (c) 2014 Vsevolod Strukchinsky ([email protected])

[npm-url]: https://npmjs.org/package/parse-bem-identifier
[npm-image]: http://img.shields.io/npm/v/parse-bem-identifier.svg

[travis-url]: https://travis-ci.org/floatdrop/parse-bem-identifier
[travis-image]: http://img.shields.io/travis/floatdrop/parse-bem-identifier.svg

[depstat-url]: https://david-dm.org/floatdrop/parse-bem-identifier
[depstat-image]: https://david-dm.org/floatdrop/parse-bem-identifier.svg?theme=shields.io