
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
module-class
Advanced tools
Class helper for CSS modules. We use it mostly in our React projects to provide better code readibility and some quality of life methods.
npm i module-classimport ModuleClass from 'module-class';Fetches and concatenates class names from module
component.module.scss
.big {
font-size: 40px;
}
.red {
color: red;
}
component.js
import ModuleClass from 'module-class';
import styles from './component.module.scss';
let css = new ModuleClass(styles);
<div class={css.class('big', 'red' ...)}></div>
Result
<div class="component_big__1fNF_ component_red__1fNF_"></div>
Simply stick together any amount of class name strings.
css.compose('big', 'red');
Results
<div class="big red"></div>
The main usage of this method is to combine different module names. Sometimes it is neccesery to just append classnames without translate its name to module name.
Practical exapmle would be a react component accepting an outside module classname via className prop.
form.js
import ModuleClass from 'module-class';
import styles from './form.module.scss';
let css = new ModuleClass(styles);
export default function Form() {
return (
<div class={css.class('form')}>
<Button className={css.class('button')} />
</div>
)
}
button.js
import ModuleClass from 'module-class';
import styles from './button.module.scss';
let css = new Button(styles);
export default function Form({ className }) {
return (
<button class={css.compose(css.class('button'), className)}>Name</button>
)
}
FAQs
Class helper for CSS modules.
The npm package module-class receives a total of 4 weekly downloads. As such, module-class popularity was classified as not popular.
We found that module-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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.