https://github.com/smart-table/smart-table-json-pointer
json pointer
https://github.com/smart-table/smart-table-json-pointer
json object smart-table
Last synced: 2 months ago
JSON representation
json pointer
- Host: GitHub
- URL: https://github.com/smart-table/smart-table-json-pointer
- Owner: smart-table
- License: mit
- Created: 2017-02-01T16:45:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T17:41:17.000Z (almost 5 years ago)
- Last Synced: 2025-10-05T07:26:25.688Z (9 months ago)
- Topics: json, object, smart-table
- Language: JavaScript
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# smart-table-json-pointer
[](https://circleci.com/gh/smart-table/smart-table-json-pointer)
1. Access nested property within an object
2. Replace nested value with a new value
For nodejs and browsers.
## Installation
### npm
``npm install --save smart-table-json-pointer``
### yarn
``yarn add smart-table-json-pointer
## Usage
```Javascript
import jsonPointer from 'smart-table-json-pointer'
const pointer = jsonPointer('foo.bar.woot');
pointer.get({foo:'value'});
// > undefined
pointer.get({foo:{bar:{woot:'value'}}});
// > 'value'
const target = {foo:{bar:{woot:{blah:'nut'}}}};
pointer.set(target,{ni:'bup'});
console.log(target);
// > {foo:{bar:{woot:{ni:'bup'}}}};
```