json-access
access json with path(split by '/')
Install
npm i json-access -S
Usage
const jsonAccess = ;let a = level1: 'name' level2: 100 level3: 1 2 3 4 5 level4: name: 'sub' 'level5': name: 'test' objs: name: 'sub' ; console;console;console;console;console;console;console; console;console;console;
function desc:
|name|desc| |-| |get| throw error when path not exist or bad format| |getEx(input, path, def)|return def when error| |delete| return this, throw error when bad format| |deleteEx| return this|
path desc:
path item split by '/' exp: level3/2 level3: json map
Example
See example.
License
The MIT License