Skip to content

A utility for working with RFC 6901 pointers, and a bit more.

Notifications You must be signed in to change notification settings

collinbrewer/json-pointer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSONPointer

A javascript implementation of the RFC 6901 Spec: http://tools.ietf.org/html/rfc6901

There are many fine implementations of the spec but JSONPointer offers additional functionality.

Basic Usage

var doc={
   "foo" : {
      "bar" : "value"
   }
};

var pointer=new JSONPointer("/foo/bar");

pointer.evaluate(doc); // returns "value"

Extensibility

JSONPointer can be extended to support various needs.

var pointer=new JSONPointer("foo.bar", {delimiter:"."});

pointer.evaluate(doc); // returns "value"

Class Factory

JSONPointer also offers a class factory for creating custom pointer types.

var DotPointer=JSONPointer.Factory({delimiter:"."});

var pointer=new DotPointer("foo.bar");

pointer.evaluate(doc); // returns "value"

About

A utility for working with RFC 6901 pointers, and a bit more.

Resources

Stars

Watchers

Forks

Packages

No packages published