1
|
# invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv)
|
2
|
|
3
|
> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`
|
4
|
|
5
|
|
6
|
## Install
|
7
|
|
8
|
```
|
9
|
$ npm install invert-kv
|
10
|
```
|
11
|
|
12
|
|
13
|
## Usage
|
14
|
|
15
|
```js
|
16
|
const invertKv = require('invert-kv');
|
17
|
|
18
|
invertKv({foo: 'bar', unicorn: 'rainbow'});
|
19
|
//=> {bar: 'foo', rainbow: 'unicorn'}
|
20
|
```
|
21
|
|
22
|
|
23
|
## License
|
24
|
|
25
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|