# easy-bem

> Easy BEM class name generator

Latest version **1.1.1** (published 2021-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-bem
pnpm add easy-bem
yarn add easy-bem
bun add easy-bem
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-02-28 |
| First published | 2019-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | norserium |
| Keywords | react, bem |

## Links

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2021-02-28
- 1.1.0 — 2021-02-28
- 1.0.2 — 2019-06-22
- 1.0.1 — 2019-04-13
- 1.0.0 — 2019-04-09

## README

# Easy BEM class name generator

> Simple and fast [BEM](https://en.bem.info/) class names generator.

[![NPM](https://img.shields.io/npm/v/easy-bem.svg)](https://www.npmjs.com/package/easy-bem)


Fork of [bem-cn-fast](https://github.com/GREENpoint/bem-cn-fast) that uses another delimiters (personally I like them more):

- The element name is separated from the block name by a double underscore (`__`)
- The modifier name is separated from the block or element name by a double dash (`--`)
- The modifier value is separated from the modifier name by a single underscore (`_`)

## Install

```bash
npm install --save easy-bem
```

```bash
yarn add easy-bem
```

## Usage

```javascript
import bem from 'easy-bem';
const b = bem('block');

b(); // -> 'block'
b('element'); // -> 'block__element'
b({ mod1: true, mod2: 'some-value' }); // -> 'block--mod1 block--mod2_some-value'
b('element', { mod1: true }); // -> 'block__element--mod1'
```

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