🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

jsonpointer.js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonpointer.js

JavaScript implementation of JSON Pointer

0.4.0
latest
Source
npm
Version published
Maintainers
1
Created

What is jsonpointer.js?

The jsonpointer.js npm package is a utility for handling JSON Pointers, which are a way to reference specific parts of a JSON document. It allows you to get, set, and delete values within a JSON object using a string syntax defined by RFC 6901.

What are jsonpointer.js's main functionalities?

Get Value

This feature allows you to retrieve a value from a JSON object using a JSON Pointer string.

const jsonpointer = require('jsonpointer.js');
const obj = { foo: { bar: 'baz' } };
const value = jsonpointer.get(obj, '/foo/bar');
console.log(value); // 'baz'

Set Value

This feature allows you to set a value in a JSON object at the location specified by a JSON Pointer string.

const jsonpointer = require('jsonpointer.js');
const obj = { foo: { bar: 'baz' } };
jsonpointer.set(obj, '/foo/bar', 'qux');
console.log(obj.foo.bar); // 'qux'

Delete Value

This feature allows you to delete a value from a JSON object at the location specified by a JSON Pointer string.

const jsonpointer = require('jsonpointer.js');
const obj = { foo: { bar: 'baz' } };
jsonpointer.remove(obj, '/foo/bar');
console.log(obj.foo.bar); // undefined

Other packages similar to jsonpointer.js

Keywords

jsonpointer

FAQs

Package last updated on 24 Jun 2014

Did you know?

Socket

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