clsf
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

clsf, classnames

A function that merges the given class names, regardless of their format. It also filters out invalid class names, and is compatible with several frameworks such as react, angular, vue, ember, and many more !

NPM Version Package License NPM Downloads Coverage

Installation

# Using npm 
npm install --save clsf
 
# Using yarn 
npm add --save clsf

🌎 Usage

const clsf = require('clsf');
 
clsf('a', 'b', 'c');
//=> 'a b c'
 
clsf('a b', 'c d', 'e f');
//=> 'a b c d e f'
 
clsf(['a', 'b'], ['c', 'd']);
//=> 'a b c d'
 
clsf(['a b', 'c d'], ['e f', 'g h']);
//=> 'a b c d e f g h'
 
clsf('a', 'b', ifAlready && 'c');
//=> 'a b'
 
clsf('a', 'b', 'c', null, ['d', null], () => {}, 'e', undefined);
//=> 'a b c d e'

🎁 Using Typescript

import cls from 'clsf';
// or
import { cls } from 'clsf';

⭐ Support for

clsf is an open source project licensed by MIT. You can grow thanks to the sponsors and the support of the amazing sponsors. If you want to join them, contact me here.

🎩 Stay in touch

🚀 Contributors

Thanks to the wonderful people who collaborate with me !

📜 License

clsf under License MIT.

Dependents (0)

Package Sidebar

Install

npm i clsf

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

4.4 kB

Total Files

4

Last publish

Collaborators

  • yonicb