
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@dr/bem-helper
Advanced tools
Helper functions to create BEM-style classnames
npm install @dr/bem-helper
import bem from "@dr/bem-helper";
var className = bem("block", "element", { modifier: true });
// className = "block__element block__element--modifier"
A function that creates all applicable combinations of classnames for an element scoped to a block in BEM-style format.
block
(string) - The block element for the classname....args
(string|object) - Optional. Any number of the following arguments are allowed:
element
(string) - Optional.modifier
(object) - Optional. Keys are used for modifier names. Values determine whether to turn the modifier off (false
, ""
, null
or undefined
) or on - either through true
or a value which will be appended to the modifier name; {modifier: true}
-> "--modifier"
, {modifier: "value"}
-> "--modifier-value"
. Should not follow a previous modifier argument.
var className = bem("block", "element");
// className === "block__element"
var className = bem("block", { modifier: true });
// className === "block block--modifier"
var className = bem("block", "element", { modifier: "value", modifier2: false });
// className === "block__element block__element--modifier-value"
var boundBem = bem.bind(null, "block");
var className = boundBem("element", { modifier: true });
// className === "block__element block__element--modifier"
FAQs
Helper functions to create BEM-style classnames
The npm package @dr/bem-helper receives a total of 295 weekly downloads. As such, @dr/bem-helper popularity was classified as not popular.
We found that @dr/bem-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 55 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.