EN
Forum

Methodology

Toolbox

Platform

naming.file.stringify

BEM file system schemes.

Usage

const BemFile = require('@bem/sdk.file');

const file = new BemFile({
    cell: {
        block: 'b1',
        elem: 'e1',
        mod: {name: 'm1', val: 'v1'},
        tech: 'js',
        layer: 'desktop'
    },
    level: 'node_modules/bem-core'
});

const stringify = require('@bem/sdk.naming.file.stringify')(require('@bem/sdk.naming.presets/origin'));

stringify(file); // node_modules/bem-core/desktop.blocks/b1/__e1/_m1/b1__e1_m1_v1.js

License

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

Оцените статью
Report an error on GitHub or correct using prose.io.