dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/jsonpointer
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00
..
.travis.yml Add .vscode 2016-09-11 10:29:13 +02:00
jsonpointer.js Add .vscode 2016-09-11 10:29:13 +02:00
package.json Add .vscode 2016-09-11 10:29:13 +02:00
README.md Add .vscode 2016-09-11 10:29:13 +02:00
test.js Add .vscode 2016-09-11 10:29:13 +02:00

JSON Pointer for nodejs

This is an implementation of JSON Pointer.

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.
$

Build Status

Author

(c) 2011 Jan Lehnardt jan@apache.org

License

MIT License.