# convert-keys

> Convert object keys to camelCase or snakeCase.

Latest version **1.3.4** (published 2019-03-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2019-03-11 |
| First published | 2016-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hiroppy |
| Maintainers | hiroppy |
| Keywords | camelcase, snakecase, convert, keys |

## Links

- npm: https://www.npmjs.com/package/convert-keys
- npm.io page: https://npm.io/package/convert-keys

## Dependencies (4)

- [lodash.forown](https://npm.io/package/lodash.forown.md) ^4.4.0
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [lodash.snakecase](https://npm.io/package/lodash.snakecase.md) ^4.1.1
- [lodash.isplainobject](https://npm.io/package/lodash.isplainobject.md) ^4.0.6

## 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.3.4 (latest) — 2019-03-11
- 1.3.3 — 2019-02-23
- 1.3.2 — 2018-11-08
- 1.3.1 — 2018-07-26
- 1.3.0 — 2018-07-25
- 1.2.0 — 2016-12-19
- 1.1.0 — 2016-11-23
- 1.0.1 — 2016-11-22
- 1.0.0 — 2016-11-22

## README

# convert-keys

[![Build Status](https://travis-ci.org/hiroppy/convert-keys.svg?branch=master)](https://travis-ci.org/hiroppy/convert-keys)
[![codecov](https://codecov.io/gh/hiroppy/convert-keys/branch/master/graph/badge.svg)](https://codecov.io/gh/hiroppy/convert-keys)
[![npm version](https://badge.fury.io/js/convert-keys.svg)](https://badge.fury.io/js/convert-keys)

# Install
```
$ npm install convert-keys
```

# Usage
```javascript
const convertKeys = require('convert-keys');

const obj = {
  'hoge_fuga': 1,
  hogeHoge: {
    'piyo_piyo': 'aaaa',
    'fuga_fuga': 'bbbb'
  }
};

convertKeys.toCamel(obj);

// output
{
  hogeFuga: 1,
  hogeHoge: {
    piyoPiyo: 'aaaa',
    fugaFuga: 'bbbb'
  }
}

convertKeys.toSnake(obj);

// output
{
  'hoge_fuga': 1,
  'hoge_hoge': {
    'piyo_piyo': 'aaaa',
    'fuga_fuga': 'bbbb'
  }
}

```

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