Skip to content

Latest commit

 

History

History
88 lines (73 loc) · 2.16 KB

README.md

File metadata and controls

88 lines (73 loc) · 2.16 KB

b-add

A small cli utility helps you to easily add BEM-blocks in the file system of your project

Features

  • Automatic creation of files and directories
  • Configuring file extensions for each type of BEM class (block, element and their modifiers)
  • Setting separators for modifiers and elements

Using

user:~/project$ b_add logo__img_size_big container__sidebar
user:~/project$ tree

├── app
│   └── blocks
│       ├── container
│       │   ├── __sidebar
│       │   │   ├── container__sidebar.jade
│       │   │   └── container__sidebar.styl
│       │   ├── container.jade
│       │   ├── container.styl
│       │   └── container.wiki
│       └── logo
│           ├── __img
│           │   ├── logo__img.jade
│           │   ├── logo__img.styl
│           │   └── logo__img_size_big.styl
│           ├── logo.jade
│           ├── logo.styl
│           └── logo.wiki

Installation

root:~$ npm install -g b_add

Settings

All options are available in the file b_add.json

blockLocation The path to the folder with blocks

elem The separator for the element

mod The separator for the modifier

files Settings extensions for files

  • block An array of file extensions block
  • blockMod An array of file extensions block modifier
  • elem Массив расширений файлов элемента
  • elemMod An array of file extensions element
{
  "blockLocation": "./app/blocks/",
  "elem": "__",
  "mod": "_",
  "files": {
    "block": [".styl", ".jade", ".wiki"],
    "blockMod": [".styl"],
    "elem": [".styl", ".jade"],
    "elemMod": [".styl"]
  }
}

License

Project distributed under the MIT license. For more information, see file LICENSE

Used modules

"Yandex.Metrika counter"