bem-graph is a JavaScript library (v0.0.3, latest) for managing dependency graphs of BEM entities. It allows defining ordered and unordered links between entities (blocks, elements, modifiers) and resolving dependencies for a given declaration of entities, returning the full set of required entities per technology. It works with BemEntityName objects and bem-decl format. Key differentiators: lightweight, simple API, supports naturalization of links, and detects cycles in ordered links. Current status: active but low release cadence (last release likely 2016). Requires Node >=4.
npm install bem-graphNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a graph, define dependencies between BEM entities, and resolve dependencies for a declaration.
Ensure no cycles in ordered links. Use linkWith for unordered links that allow cycles.
Use objects with block, elem, modName, modVal properties as defined by bem-entity-name.
Ensure declaration array elements follow BemEntityName structure.
Use 'const BemGraph = require("bem-graph");' instead of ES import.Change dependencies to avoid cycles or use linkWith for unordered links.
No dependency data recorded yet.