https://github.com/drptbl/magellan-poc
https://github.com/drptbl/magellan-poc
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/drptbl/magellan-poc
- Owner: drptbl
- Created: 2015-09-04T15:06:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-04T15:07:50.000Z (almost 11 years ago)
- Last Synced: 2025-07-02T00:41:08.174Z (12 months ago)
- Language: JavaScript
- Size: 45.9 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON Pointer for nodejs
This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).
## Usage
var jsonpointer = require("jsonpointer");
var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};
var one = jsonpointer.get(obj, "/foo");
var two = jsonpointer.get(obj, "/bar/baz");
var three = jsonpointer.get(obj, "/qux/0");
var four = jsonpointer.get(obj, "/qux/1");
var five = jsonpointer.get(obj, "/qux/2");
var notfound = jsonpointer.get(obj, "/quo"); // returns null
jsonpointer.set(obj, "/foo", 6); // obj.foo = 6;
## Testing
$ node test.js
All tests pass.
$
[](https://travis-ci.org/janl/node-jsonpointer)
## Author
(c) 2011 Jan Lehnardt
## License
MIT License.