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.
one-spaces
Advanced tools
A tiny module for making className 😎
We are striving for the best performance and lightweight.
Please check our benchmark result!!!
npm install one-spaces
Please download this file.
And embed script tag in your document.
<script src="./dist/one-spaces.js"></script>
var el = document.getElementById("my-element");
// arguments
el.className = spaces("cls1", "cls2", "cls3");
// array
el.className = spaces(["cls1", "cls2"], ["cls3"]);
// exclude falsy
el.className = spaces(
"cls1",
null,
"cls2",
false && "none",
true && "cls3",
[]
);
// mix
el.className = spaces(["cls1", "cls2"], null, "cls3");
// without one-spaces
el.className = "cls1 cls2" + " cls3";
import React, { useState } from "react";
import spaces from "one-spaces";
import styles from "./Page.css";
export default () => {
const [isActive, setActive] = useState(false);
return (
<div className={styles.container}>
<span className={spaces(styles.text, isActive && styles.active)}>
Hello React!
</span>
<button onClick={() => setActive(!isActive)}>Toggle</button>
</div>
);
};
Angular and Vue have their own system for className.
Of course you can use this module with them but not recommended.
FAQs
A tiny module for making className 😎
We found that one-spaces 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.