1 # map-obj [![Build Status](https://travis-ci.org/sindresorhus/map-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/map-obj)
3 > Map object keys and values into a new object
9 $ npm install --save map-obj
16 const mapObj = require('map-obj');
18 const newObject = mapObj({foo: 'bar'}, (key, value) => [value, key]);
25 ### mapObj(source, mapper, [options])
31 Source object to copy properties from.
39 - It has signature `mapper(sourceKey, sourceValue, source)`.
40 - It must return a two item array: `[targetKey, targetValue]`.
47 Recurse nested objects and objects in arrays.
54 Target object to map properties on to.
59 - [filter-obj](https://github.com/sindresorhus/filter-obj) - Filter object keys and values into a new object
60 - [object-assign](https://github.com/sindresorhus/object-assign) - Copy enumerable own properties from one or more source objects to a target object
65 MIT © [Sindre Sorhus](https://sindresorhus.com)