Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
.For Node.js, to install class-name-prop
with npm, run:
npm install class-name-prop
For Deno and browsers, an example import map:
{
"imports": {
"class-name-prop": "https://unpkg.com/class-name-prop@6.0.0/classNameProp.mjs"
}
}
Then, import and use the function classNameProp
.
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,
});
}
Supported runtime environments:
^14.17.0 || ^16.0.0 || >= 18.0.0
.> 0.5%, not OperaMini all, not dead
.Non Deno projects must configure TypeScript to use types from the ECMAScript modules that have a // @ts-check
comment:
compilerOptions.allowJs
should be true
.compilerOptions.maxNodeModuleJsDepth
should be reasonably large, e.g. 10
.compilerOptions.module
should be "node16"
or "nodenext"
.The npm package class-name-prop
features optimal JavaScript module design. These ECMAScript modules are exported via the package.json
field exports
:
6.0.0
^14.17.0 || ^16.0.0 || >= 18.0.0
.main
field.node:
URL scheme for Node.js builtin module imports in tests.jsconfig.json
:
compilerOptions.maxNodeModuleJsDepth
to 10
.compilerOptions.module
to nodenext
.actions/checkout
to v3.actions/setup-node
to v3.not IE > 0
from the Browserslist query.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 56 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.