replaces all values in a JSON object, no matter how deep.
npm install --save json-value-replacer
const jsonValueReplacer = require('json-value-replacer');
const obj = { 'a': 'value a', 'b': 'value b', 'c': { 'd': 'value c', 'e': { 'f': 'value f' } } };
console.log(jsonValueReplacer(obj, "#####"));
// -> { a: '#####', b: '#####', c: { d: '#####', e: { f: '#####' } } }
console.log(jsonValueReplacer.shuffle(obj));
// -> { a: ' luaave', b: 'bulave ', c: { d: 'c eulav', e: { f: 'flaev u' } } }
console.log(jsonValueReplacer.sameLength(obj, '#'));
// -> { a: '#######', b: '#######', c: { d: '#######', e: { f: '#######' } } }
MIT © Sebastian Roming