1.0.4 • Published 8 years ago

remap-keys v1.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

remap-keys

npm.io npm.io Build Status Dependency Status js-standard-style

Rename the keys of a JavaScript Object simply by using a map/dict to do it

Usage

var remapKeys = require('remap-keys')

var obj = {
  data: 'aaah the data'
}

obj = remapKeys(obj, {
  data: 'newKey'
})

console.log(obj)
// { newKey: 'aaah the data'

Credits

While I was looking for a solution to remap keys in a JS obj, I found an incomplete version in Stack Overflow by tldr which I used as inspiration for this module.

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago