Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

classix

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classix - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "classix",
"version": "1.0.4",
"version": "1.0.5",
"description": "A tiny utility for conditionally joining classNames.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# classix
The [fastest](#comparison) and [tiniest](#comparison) utility for conditionally joining classNames.
## Installation

@@ -11,2 +13,4 @@

Use any amount of string expressions and classix will join them like so:
```js

@@ -35,3 +39,3 @@ import cx from "classix";

cx(...['class1', 'class2', 'class3']);
cx(...["class1", "class2", "class3"]);
// => class1 class2 class3

@@ -47,9 +51,31 @@

## Comparison
| | classix | clsx | classnames |
| ------------ | ------------------------------------------------ | --------------------------------------------- | --------------------------------------------------- |
| **Size** | [281B](https://bundlephobia.com/package/classix) | [330B](https://bundlephobia.com/package/clsx) | [454B](https://bundlephobia.com/package/classnames) |
| **Ops/s\*** | 29M | 28M | 7M |
| **Strings** | Yes | Yes | Yes |
| **Numbers** | Yes | Yes | Yes |
| **Booleans** | Yes | Yes | Yes |
| **Arrays** | Yes with spreading | Yes | Yes |
| **Objects** | No\*\* | Yes | Yes |
\*Operations per second on an AMD Ryzen 5 5600x
\*\*classix aims to provide the fastest and tiniest utility by ommiting the object API, which it considers less ergonomic than standard function arguments:
```js
// 🚫
cx({ class1: isPrimary && isLarge, class2: !isPrimary || !isLarge });
// ✅
cx(isPrimary && isLarge ? "class1" : "class2");
```
## Highlights
- Fast
- Under 1 kB minified & gzipped
- Typed with TypeScript
- Fastest & tiniest
- Zero dependencies
- Fully typed (with TypeScript)
- Fully tested
- Zero dependencies
- Follows [semantic versioning](https://semver.org/)

@@ -56,0 +82,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc