
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
BEM class name formatter
var b = require('b_');
// blocks
b('button', {size: 'xl'}) === 'button button_size_xl';
// block elements
b('modal', 'close', {size: 'xl'}) === 'modal__close modal__close_size_xl';
// boolean modifiers
b('button', {hidden: false}) === 'button';
b('button', {hidden: true}) === 'button button_hidden';
var B = require('b_').B;
var b = B({
tailSpace: ' ',
elementSeparator: '-',
modSeparator: '--',
modValueSeparator: '-',
classSeparator: ' '
});
b('block', 'elem', {mod1: true, mod2: false, mod3: 'mod3'}) ===
'block-elem block-elem--mod1 block-elem--mod3-mod3 ';
var B = require('b_').B;
var b = B({isFullModifier: false});
b('button_call-for-action', {disabled: true, focused: 'yes'}) ===
'button_call-for-action _disabled _focused_yes';
var B = require('b_').B;
var b = B({isFullBoolValue: true});
b('button', {disabled: true, focused: false}) ===
'button button_disabled_true button_focused_false';
var b = require('b_').with('b-button');
// or
var b = require('b_').lock('b-button');
// which is `require('b_').bind(null, 'b-button');` but much convenient
function render() {
return (
<div className={b()}>
<span className={b('icon', {type: 'add'})}></span>
<span className={b('text')}></span>
</div>
<div className={b({size: 'small'})}>
<span className={b('icon', {type: 'add'})}></span>
<span className={b('text')}></span>
</div>
);
}
FAQs
BEM class name generator
The npm package b_ receives a total of 11,656 weekly downloads. As such, b_ popularity was classified as popular.
We found that b_ 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.