You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 555B

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