
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
A bit simpler utility for conditionally joining classNames together.
It’s simplified version of classnames package. The original package is not
very lage in size, but it can be a bit simpler. Also, it has no ES-modules
verison, and TypeScript types should be installed separately. A lot of problems
for so small and simple package, so I write my own in TypeScript.
There is only two options:
If you want to take classes from several objects, just combine them useing
Object.assign or spread operator and use resulting object.
For bundlers and other NPM-based environments:
npm install --save-dev classjoin
The first argument of the function is object and it’s required (because it’s the
main purpose of this package, if you want just to combine classes from array,
you can use .join( ' ' )).
You can use second argument to specify classes, that should be added to the output. This argument is not required and can be omitted. Classes from this array added to the output string before classes from the object (because they always exists).
function MyComponent( {active, disabled, items} )
{
const className = classJoin(
{
active,
disabled,
multiple: ( items.length > 1 ),
},
[
'my-component',
]
);
return (
<div className={className}></div>
);
}
// <MyComponent active items={['one', 'two']} />
// → <div class="my-component active multiple"></div>
UMD is default for this package, so just use something like:
import classJoin from 'classjoin';
// or
const classJoin = require( 'classjoin' );
For using directly in browser (import with <script> tag in HTML-file):
You can use AMD or classJoin global variable.
Package contain module property for use with ES2015 module bundlers
(like Rollup and Webpack 2).
If you don’t want to use transplitted to ES5 code, you can use included ES2015 version.
You can directly import this version:
import classJoin from 'classjoin/es2015';
Or specify alias in Webpack config:
{
// …
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
'classjoin': 'classjoin/es2015',
},
},
};
MIT.
FAQs
A bit simpler utility for conditionally joining classNames together
The npm package classjoin receives a total of 58 weekly downloads. As such, classjoin popularity was classified as not popular.
We found that classjoin 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.