Welcome to complex-json 👋
Access the deep objects inside an object with ease.
Install
npm install complex-json -save
Api
get - returns valueset - returns JSONdel - returns JSONhas - returns Boolean getPath - returns path in array format
Usage:
var json = "a": "b": "c":"value" "d":"val" "b1": "c":"value" "d1":"val" var complexJson = ; // If key is duplicate in any section,It is mandatory pass the third param which is the parent key // If parent key is not passed & duplicate key is present-returns undefiedcomplexJson; // returns modified json //set accepts key,value in array-can be used to set/change multiple keys at a timevar keys='c''d1';var values='new-c-value''new-d1-value'var parentKeys='b''b1'complexJson; // returns modified json complexJson; // returns truecomplexJson; // returns modified json// If parentKey passed returns specific value/path, If not returns every matched value/pathcomplexJson; // returns 'value'complexJson; // returns array
Author
👤 vignesh
- Twitter: @vigneshkv23
- Github: @vigneshkv23
- LinkedIn: @vigneshkv23
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
complex-json developed with ❤️