bemdeps

Converting jsdoc @deps directives to deps.js file

npm install bemdeps
7 downloads in the last week
26 downloads in the last month

Converting jsdoc @deps directives to deps.js file

install

npm install bemdeps

or

npm install -g bemdeps

options

-l --levels bem levels (default is "blocks-desktop and blocks-common")
-t --tetchs bem tetchs (default is "css js bemhtml")
-f --forse will replace original deps.js file without extending

example

/**
 * @deps b-block1, b-block2 elem1 elem2, !b-block3 mod_val
 */

is equal to

/**
 * @shouldDeps b-block1, b-block2 elem1 elem2
 * @mustDeps b-block3 mod_val
 */

and will convenrts into

({
    "mustDeps": [
        {
            "block": "b-block3",
            "mods": {
                "mod": "val"
            }
        }
    ],
    "shouldDeps": [
        {
            "block": "b-block1"
        },
        {
            "block": "b-block2",
            "elems": [
                "elem1",
                "elem2"
            ]
        }
    ]
})

usage

bemdeps -l blocks-desktop blocks-touch blocks-common -t js css
npm loves you