|
1 | 1 | # json-nested-replace |
| 2 | + |
| 3 | +[](https://travis-ci.com/arshadkazmi42/json-nested-replace) |
| 4 | +[](https://github.com/arshadkazmi42/json-nested-replace) |
| 5 | +[](https://github.com/arshadkazmi42/json-nested-replace/graphs/contributors) |
| 6 | +[](https://github.com/arshadkazmi42/json-nested-replace/commits/master) |
| 7 | + |
2 | 8 | Searches and replace values at every level of nested json |
| 9 | + |
| 10 | +> Give us a :star: if you like our work :heart: |
| 11 | +
|
| 12 | +<a href="https://www.buymeacoffee.com/arshadkazmi42" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a> |
| 13 | +<a href="https://www.patreon.com/bePatron?u=15454240" target="_blank"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Become a Patron!" height="40"></a> |
| 14 | + |
| 15 | +Please consider donating, if you like my work |
| 16 | + |
| 17 | +## Install |
| 18 | + |
| 19 | +``` |
| 20 | +$ npm install json-nested-replace |
| 21 | +``` |
| 22 | + |
| 23 | +## Usage |
| 24 | + |
| 25 | +```javascript |
| 26 | +const jnestedReplace = require('json-nested-replace'); |
| 27 | + |
| 28 | +const INPUT_JSON = { |
| 29 | + 'name': 'json-nested-replace', |
| 30 | + 'author': 'Arshad Kazmi', |
| 31 | + 'repository': { |
| 32 | + 'url': 'https://github.com/arshadkazmi42/json-nested-replace', |
| 33 | + 'language': 'js' |
| 34 | + } |
| 35 | +}; |
| 36 | + |
| 37 | +const replacedJSONValue = jnestedReplace(INPUT_JSON, 'json-nested-replace', 'jnested-replace'); |
| 38 | +console.log(replacedJSONValue); |
| 39 | +// Output |
| 40 | +/** { |
| 41 | + * 'name': 'jnested-replace', |
| 42 | + * 'author': 'Arshad Kazmi', |
| 43 | + * 'repository': { |
| 44 | + * 'url': 'https://github.com/arshadkazmi42/jnested-replace', |
| 45 | + * 'language': 'js' |
| 46 | + * } |
| 47 | + * } |
| 48 | + **/ |
| 49 | + |
| 50 | + |
| 51 | +const replacedStringValue = jnestedReplace('json-nested-replace', 'json-nested', 'jnested'); |
| 52 | +console.log(replacedStringValue) |
| 53 | +// Output |
| 54 | +// jnested-replace |
| 55 | + |
| 56 | +``` |
| 57 | + |
| 58 | +## Contributing |
| 59 | + |
| 60 | +Interested in contributing to this project? |
| 61 | +You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/json-nested-replace/issues/new) |
| 62 | + |
| 63 | +Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase |
0 commit comments