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 2.1.15 to 2.1.16

2

package.json
{
"name": "classix",
"version": "2.1.15",
"version": "2.1.16",
"description": "The fastest and tiniest utility for conditionally joining classNames.",

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

@@ -9,3 +9,3 @@ ![Banner](media/banner.jpg)

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

@@ -56,5 +56,5 @@ ## Installation

## Why?
## Comparison
classix considers string expressions faster to type and easier to reason about (conditions first, followed by classNames) than the alternative:
Compared to other libraries, classix only allows string expressions as arguments:

@@ -73,6 +73,16 @@ ```js

This reasoning enables classix to simplify its API by allowing only string expressions as arguments. Not only does it provide a consistent way of joining classNames, but using classix also leads to [better performance](#comparison) and a [smaller bundle size](#comparison) for your application.
String expressions have a few benefits over objects:
## Comparison
- A faster typing experience
- A more intuitive syntax (conditions first)
- `else` support through ternary operators
What's more, by leveraging them, classix provides:
- A simpler and consistent API
- [A smaller library size](#size)
- [Better performance](#performance)
### Size
![Size comparison chart](media/size.png)

@@ -82,2 +92,4 @@

### Performance
![Performance comparison chart](media/perf.png)

@@ -109,4 +121,4 @@

```diff
- classnames({ 'class-1': cond });
+ cx(cond && 'class-1')
- classnames({ 'class-1': cond1, 'class-2': cond2 });
+ cx(cond1 && 'class-1', cond2 && 'class-2')
```

@@ -113,0 +125,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