
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A tiny tool for easily building BEM class names in JavaScript.
const disabled = true;
const isOn = false;
const className = bembam("block", "other-name") // block name and any additional class names
.mod("green") // unconditional modifier
.mod("disabled", disabled) // conditional modifier
.mod("on", "off", isOn); // conditional modifier with disabled class name
const elName = className.el("element"); // block__element
className.toString(); // returns "block other-name block--green block--off"
With React:
class Zoo extends React.Component {
render() {
const {disabled, open, className} = this.props;
const cn = bembam("zoo", className)
.mod("disabled", disabled)
.mod("open", open)
.mod("awesome");
return (
<div className={cn.toString()}>
<button className={cn.el("dog")}>Woof!</button>
<button className={cn.el("cat")}>Meow</button>
</div>
);
}
}
bembam(blockName:String [, ...otherNames:String]) -> BemBamCreates a bembam instance. Takes the blockname and any number of additional classnames. Falsy classnames will be ignored.
#mod(modifierName:String [, disabledModifierName:String], conditional:Bool) -> BemBamAdds the modifier name to the bembam instance if conditional is either not defined or truthy. The modifier will be rendered as blockName--modifierName in the result string. If three arguments are passed, the final argument is the conditional and the second argument is used as the modifier name if the condition is falsy. Falsy modifier names will be ignored. Returns the original BemBam instance for chaining.
#el(elementName:String) -> StringReturns an element string based on the block name and passed element name. The return value will have the format: blockName__elementName. Falsy element names will throw errors.
#toString() -> StringRenders the class names and modifiers into a single class string with classnames seperated by spaces.
FAQs
A tiny tool for easily building BEM class names in JavaScript.
We found that bembam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.