
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@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 342 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.