remap-keys
Rename the keys of a JavaScript Object simply by using a map/dict to do it
Last updated 8 years ago by daviddias .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install remap-keys 
SYNC missed versions from official npm registry.

remap-keys

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.

Current Tags

  • 1.0.4                                ...           latest (8 years ago)

5 Versions

  • 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
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE