
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
$ npm install --save-dev bem-class
Create a new block by calling bem.block('some-block-name')
and storing the return value. You can apply modifiers to the block by chaining .modifier({ 'someModifier': true })
onto the end of the bem.block('')
call.
var bem = require('bem-class');
var age = 17;
var personBlock = bem.block('person')
.modifier({
'child': (age < 18)
});
console.log(personBlock.toString()); // "person person--child"
You can create elements by calling .element('some-element-name')
on the result of bem.block('')
and storing the return value, or by chaining directly onto the end of the block/modifier call. Elements can also be modified in the same way blocks can, by chaining .modifier({ 'someModifier': false });
onto the end of the element call.
var isWaving = false;
var handElement = personBlock.element('hand')
.modifier({
'waving': isWaving
});
console.log(handElement.toString()); // "person__hand"
var isHungry = true;
var tummyElement = personBlock.element('tummy')
.modifier({
'rumbling': isHungry
});
console.log(tummyElement.toString()); // "person__tummy person__tummy--rumbling"
Shown below is an example render
method from a React component:
var bem = require('bem-class');
class SomeComponent extends React.Component {
render () {
var container = bem.block('some-block-name');
var paragraph = container.element('some-element')
.modifier({
'some-enabled-modifier': true,
'some-disabled-modifier': false
});
return (
<div className={container}>
<p className={paragraph}></p>
</div>
);
}
}
Both BEM_Block
and BEM_Element
have a toString
method which returns the complete, space-separated list of class names pertaining to the current instance.
FAQs
Generate BEM class names based by chaining
The npm package bem-class receives a total of 0 weekly downloads. As such, bem-class popularity was classified as not popular.
We found that bem-class 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.