Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tadatuta/valkyrie

bem-walk wrapper
https://github.com/tadatuta/valkyrie

Last synced: 10 days ago
JSON representation

bem-walk wrapper

Awesome Lists containing this project

README

        

# bem-valkyrie

A [bem-walk](https://github.com/bem/bem-walk) wrapper.

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