bem-valkyrie

1.0.0 • Public • Published

bem-valkyrie

A bem-walk wrapper.

var levels = [
    '../../libs/bem-components/common.blocks',
    '../../libs/bem-components/desktop.blocks',
    '../../libs/bem-components/design/common.blocks',
    '../../libs/bem-components/design/desktop.blocks'
];
 
var Valkyrie = require('./valkyrie'),
    valka = Valkyrie(levels);
 
valka
    .on('*', function(files) {
        // all the files of all the entities
    })
    .on('block', function(files) {
        // all blocks files
    })
    .on({ block: 'select' }, function(files) {
        // all files of `select` block
    })
    .on({ tech: 'examples' }, function(files) {
        // all files with `examples` tech
        Valkyrie([files.path], { scheme: 'flat' })
            .on({ tech: 'blocks' }, function(files) {
                Valkyrie([files.path])
                    .on('*', function(files) {
                        console.log(files); // all files of custom blocks of an example
                    })
            });
    })
    .on('end', function(files) {
        console.log('end');
    });

Readme

Keywords

none

Package Sidebar

Install

npm i bem-valkyrie

Weekly Downloads

2

Version

1.0.0

License

MPL-2.0

Last publish

Collaborators

  • tadatuta