Initial commit
[yaffs-website] / node_modules / map-obj / readme.md
1 # map-obj [![Build Status](https://travis-ci.org/sindresorhus/map-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/map-obj)
2
3 > Map object keys and values into a new object
4
5
6 ## Install
7
8 ```
9 $ npm install --save map-obj
10 ```
11
12
13 ## Usage
14
15 ```js
16 var mapObj = require('map-obj');
17
18 var newObject = mapObj({foo: 'bar'}, function (key, value, object) {
19         // first element is the new key and second is the new value
20         // here we reverse the order
21         return [value, key];
22 });
23 //=> {bar: 'foo'}
24 ```
25
26
27 ## License
28
29 MIT © [Sindre Sorhus](http://sindresorhus.com)