Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
class-name-prop
Advanced tools
A lightweight utility function to create a React className prop value for multiple class names.
A lightweight utility function to create a React className
prop value for multiple class names.
undefined
if there are no class names, to prevent rendering a redundant class
attribute; unlike packages like classnames
.To install with npm, run:
npm install class-name-prop
These ECMAScript modules are published to npm and exported via the package.json
exports
field:
classNameProp.mjs
default
Function classNameProp
— Creates a React className
prop value for multiple class names.
...classNames
: unknown
— Class name strings to merge; only non empty strings are added to the final string.string
| undefined
— A className
prop value; either a string of 1 or more space separated class names or undefined
to prevent rendering an empty class
attribute.
A React component for a link that can be declared active, whilst supporting custom class names:
import classNameProp from "class-name-prop";
import React from "react";
function Link({ className, active, ...props }) {
return React.createElement("a", {
className: classNameProp(className, active && "active"),
...props,
});
}
5.0.0
types
script.jsdoc-md
dev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section.license.md
MIT License file.FAQs
A lightweight utility function to create a React className prop value for multiple class names.
The npm package class-name-prop receives a total of 73 weekly downloads. As such, class-name-prop popularity was classified as not popular.
We found that class-name-prop 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.