# clsnm

> A utility function for generating a string for use as a DOM element's `className`.

Latest version **0.0.2** (published 2019-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install clsnm
pnpm add clsnm
yarn add clsnm
bun add clsnm
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-07-02 |
| First published | 2019-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | atomita |
| Maintainers | atomita |
| Keywords | class, classes, className, classNames, classList |

## Links

- npm: https://www.npmjs.com/package/clsnm
- Repository: https://github.com/atomita/clsnm
- Homepage: https://github.com/atomita/clsnm#readme
- Issues: https://github.com/atomita/clsnm/issues
- npm.io page: https://npm.io/package/clsnm

## Recent versions

- 0.0.2 (latest) — 2019-07-02
- 0.0.1 — 2019-06-22

## README

# clsnm
A utility function for generating a string for use as a DOM element's `className`.


## Install

```
$ npm install --save clsnm
```


## Usage

```js
import clsnm from 'clsnm'

clsnm({ foo: true, bar: false })
//=> foo

clsnm({ foo: { bar: false } })
//=> foo

clsnm({ foo: { bar: true, baz: true } })
//=> foobar foobaz

clsnm({ foo: true, bar: { _baz: true } })
//=> foo bar_baz

clsnm({ foo: { Bar: { Baz: true } } }, v => v.replace(/[A-Z]/g, v => v.toLowerCase()))
//=> foo-bar-baz
```

## License

clsnm is MIT licensed. See [LICENSE](LICENSE.md).

---
_Source: https://npm.io/package/clsnm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
