@bem/fs-scheme

2.2.0 • Public • Published

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-

/@bem/fs-scheme/

    Package Sidebar

    Install

    npm i @bem/fs-scheme

    Weekly Downloads

    66

    Version

    2.2.0

    License

    MPL-2.0

    Unpacked Size

    37.8 kB

    Total Files

    16

    Last publish

    Collaborators

    • blond
    • qfox
    • tadatuta
    • veged
    • vithar
    • yeti-or