Socket
Socket
Sign inDemoInstall

@hyperjump/json-pointer

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hyperjump/json-pointer

An RFC-6901 JSON Pointer implementation


Version published
Weekly downloads
24K
decreased by-5.55%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

JSON Pointer

This is an implementation of RFC-6901 JSON Pointer. JSON Pointer is designed for referring to data values within a JSON document. It's designed to be URL friendly so I can be used as a URL fragment that points to a specific part of the JSON document.

Installation

npm install @hyperjump/json-pointer --save

Usage

import * as JsonPointer from "@hyperjump/json-pointer";

const value = {
  "foo": {
    "bar": 2
  }
};

JsonPointer.get(value, "/foo/bar"); // 2
JsonPointer.append("/foo", "bar"); // "/foo/bar"
JsonPointer.cons("foo", JsonPointer.nil); // "/foo"
JsonPointer.decons("/foo/bar"); // ["foo", "/bar"]

Contributing

Tests

Run the tests

npm test

Run the tests with a continuous test runner

npm test -- --watch

Keywords

FAQs

Last updated on 16 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc