Skip to content

tadatuta/valkyrie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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');
    });