Skip to content

A Node.js module that allows to rename object keys, even the nested ones.

Notifications You must be signed in to change notification settings

malek0512/json-rename-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

json-rename-keys

A Node.js module that allows to rename object keys and the nested ones.

#Simple example

var rename = require('json-rename-keys');
var jsonobject = {"sn":{"sn":{"sn":"nested key","s3":"hi"},"s2":{"s22":"coucou","sn":"nested key"}},"s1":{"sn":"nested key"}};

rename(jsonobject, function(key){
    switch(key) {
    	case "sn" : return "cn";
    }
});

#result :

{"cn":{"cn":{"cn":"nested key","s3":"hi"},"s2":{"s22":"coucou","cn":"nested key"}},"s1":{"cn":"nested key"}}

About

A Node.js module that allows to rename object keys, even the nested ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published