Skip to content
JSON Pointer implementation for NodeJS http://tools.ietf.org/html/draft-pbryan-zyp-json-pointer-00
JavaScript
Find file
Pull request Compare This branch is 41 commits behind janl:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
jsonpointer.js
package.json
test.js

README.md

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");

jsonpointer.set(obj, "/foo", 6); // obj.foo = 6;

Testing

$ node test.js
All tests pass.
$

Author

(c) 2011 Jan Lehnardt jan@apache.org

License

MIT License.

Something went wrong with that request. Please try again.