Nomeasmo / json-ptr

A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json-ptr Build Status

A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers. Made accessible to Meteor.

This is a fork of json-ptr

Please refer to this project for the syntax.

Installation

meteor add nomeasmo:json-ptr

Example

This Meteor package also adds the global JsonPtr to client and server.

    var p = JsonPointer.create('/a/b'),
        data = {
            a: {
                aDefined: true,
                a: "a.a",
                b: "a.b"
            }
        };

    test.equal(p.get(data), data.a.b);

Or using it in templates solely or within template helpers to safely access data.

<template name="basicUse">
    {{jsonPtr this "/a/b"}}
</template>

<template name="blockUse">
    {{#if jsonPtr this "/a/aDefined"}}
        {{jsonPtr this "/a/b"}}
    {{/if}}
</template>

About

A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.

License:MIT License


Languages

Language:JavaScript 97.0%Language:HTML 2.4%Language:Makefile 0.6%