@bem/deps
v0.2.2
Published
Manage BEM dependencies
Downloads
126
Readme
bem-deps
Install
$ npm install --save-dev @bem/deps
Usage
var bemDeps = require('@bem/deps'),
toArray = require('stream-to-array');
toArray(bemDeps.load({ levels: ['blocks'] }), function (err, relations) {
var declaration = [{ block: 'a' }],
res = bemDeps.resolve(declaration, relations, { tech: 'js' });
console.log(JSON.stringify(res, null, 4));
});
// {
// "entities": [
// { "block": "c" },
// { "block": "a" },
// { "block": "b" }
// ],
// "dependOn": [
// {
// "tech": "bemhtml",
// "entities": [
// { "block": "d" }
// ]
// }
// ]
// }
License
Code and documentation copyright 2015 YANDEX LLC. Code released under the Mozilla Public License 2.0.