@bem/fs-scheme

BEM file system schemes

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
77Jun 12, 2018Dec 12, 2015Minified + gzip package size for @bem/fs-scheme in KB

Readme

bem-fs-scheme

BEM file system schemes.

Supported schemes

Usage

var BemCell = require('@bem/cell'),
    BemEntityName = require('@bem/entity-name');

var atom = new BemCell(
    {
        entity: new BemEntityName({
            block: 'b1',
            elem: 'e1',
            mod: {name: 'm1', val: 'v1'}
        }),
        tech: 'js'
    }
);

var options = {
    naming: 'origin'
};

var bemFs = require('bem-fs-scheme')('nested')

bemFs.path(atom, options); // b1/__e1/_m1/b1__e1_m1_v1.js

Options

elemDirDelim and modDirDelim has meaning only for nested scheme.

Parameter Type Description Default
options object, string '"origin"'
options.naming object, string Defines delimeters and wordPattern check [@bem/naming] '"origin"'
options.elemDirDelim string Separates element's directory "__"
options.modDirDelim string Separates mod's directory "_"

Options could be one of these strings:

  • "origin"
  • "two-dashes"
  • "react"

check ./lib/presets

License

Code and documentation © 2015 YANDEX LLC. Code released under the Mozilla Public License 2.0.

[@bem/naming] : https://github.com/bem-sdk/bem-naming#bemnaming-elem-mod-wordpattern-

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.