classname-lodash
v0.1.0
Published
classname rebuilt using lodash
Downloads
2
Maintainers
Readme
classnames-lodash
classnames
, rewritten using lodash
.
classnames
is still being maintained. This is not a replacement forclassnames
.
classnames
is a fantastic library. With no dependencies, it efficiently produces a classlist from a slew of parameter types and combinations. This is a personal exercise in producing, testing, profiling, and documenting an open-source software package.
Installation
npm install classnames-lodash
Usage
import classnames from 'classnames-lodash'
classnames('foo', undefined, 'bar', null) // => 'foo bar'
Todo
- Create Yarn package
- Create Bower package
- Create script to expose
classnames()
to the global scope - Support object parameter type with class names as keys, like this:
classnames({ foo: true, bar: false }) // => 'foo'
- Implement, test, and profile
classnames.bind()
- Create alternative that does not sort
- Create alternative that does not dedupe
- Create alternative that does not sort or dedupe
Development
If you're looking to work on this project, please use the following npm
scripts to run benchmarks and tests.
Command | Effect
-------------|-------
lint
| Lints all source code in the project and displays warnings and errors to the console.
fix
| Lints all source code and fixes fixable errors in place.
test
| Runs all tests for this project.
test-watch
| Runs all tests for this project, then watches for file changes, repeat.
benchmark
| Runs benchmarks for this project and displays results on the console.