# kebabcase-keys

> Convert object keys to kebab-case

Latest version **1.0.0** (published 2019-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install kebabcase-keys
pnpm add kebabcase-keys
yarn add kebabcase-keys
bun add kebabcase-keys
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-29 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/kebabcase-keys) |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 3 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Matthias Lohscheidt |
| Maintainers | mlohscheidt |
| Keywords | map, obj, object, key, keys, value, values, val, iterate, kebabcase, kebab-case, kebab, case, dash, hyphen, dot, underscore, separator, string, text, convert, deep, recurse, recursive |

## Links

- npm: https://www.npmjs.com/package/kebabcase-keys
- Repository: https://github.com/mattii/kebabcase-keys
- Homepage: https://github.com/mattii/kebabcase-keys#readme
- Issues: https://github.com/mattii/kebabcase-keys/issues
- npm.io page: https://npm.io/package/kebabcase-keys

## Dependencies (3)

- [map-obj](https://npm.io/package/map-obj.md) ^3.0.0
- [quick-lru](https://npm.io/package/quick-lru.md) ^1.0.0
- [lodash.kebabcase](https://npm.io/package/lodash.kebabcase.md) ^4.1.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-01-29

## README

# kebabcase-keys [![Build Status](https://travis-ci.org/mattii/kebabcase-keys.svg?branch=master)](https://travis-ci.org/mattii/kebabcase-keys)

> Convert object keys to kebab-case using [`lodash.kebabcase`](https://www.npmjs.com/package/lodash.kebabcase), forked from [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) by Sindre Sorhus.


## Install

```
$ npm install kebabcase-keys
```


## Usage

```js
const kebabcaseKeys = require('kebabcase-keys');

// Convert an object
kebabcaseKeys({foo_bar: true});
//=> {'foo-bar': true}

// Convert an array of objects
kebabcaseKeys([{fooBar: true}, {bar_foo: false}]);
//=> [{'foo-bar': true}, {'bar-foo': false}]

kebabcaseKeys({foo_bar: true, nested: {unicorn_rainbow: true}}, {deep: true});
//=> {'foo-bar': true, nested: {'unicorn-rainbow': true}}
```

## API

### kebabcaseKeys(input, [options])

#### input

Type: `Object` `Object[]`

Object or array of objects to kebab-case.

#### options

Type: `Object`

##### exclude

Type: `Array<string|RegExp>`<br>
Default: `[]`

Exclude keys from being kebab-cased.

##### deep

Type: `boolean`<br>
Default: `false`

Recurse nested objects and objects in arrays.


## Related

- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys)
- [snakecase-keys](https://github.com/bendrucker/snakecase-keys)


## Credits

This is a fork from [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) by Sindre Sorhus. I just integrated a different case-converter.

## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
MIT © [Matthias Lohscheidt](https://github.com/mattii)

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