Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianroming/json-value-replacer
replaces all values in a JSON object, no matter how deep.
https://github.com/sebastianroming/json-value-replacer
Last synced: 30 days ago
JSON representation
replaces all values in a JSON object, no matter how deep.
- Host: GitHub
- URL: https://github.com/sebastianroming/json-value-replacer
- Owner: sebastianroming
- License: mit
- Created: 2018-08-26T15:57:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-31T04:44:49.000Z (over 6 years ago)
- Last Synced: 2024-10-05T17:42:11.598Z (4 months ago)
- Language: JavaScript
- Homepage: https://npmjs.com/package/json-value-replacer
- Size: 73.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-value-replacer [![Build Status](https://travis-ci.org/sebastianroming/json-value-replacer.svg?branch=master)](https://travis-ci.org/sebastianroming/json-value-replacer)
> replaces all values in a JSON object, no matter how deep.
## Install
```
npm install --save json-value-replacer
```## Usage
```js
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: '#######' } } }
```## License
MIT © [Sebastian Roming](https://webmonkey.io)