A small cli utility helps you to easily add BEM-blocks in the file system of your project
- 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
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
root:~$ npm install -g b_add
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"] } }
Project distributed under the MIT license. For more information, see file LICENSE