Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-pointer

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-pointer

Some utilities for JSON pointers described by RFC 6901

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is json-pointer?

The json-pointer npm package provides utilities for manipulating JSON data using JSON Pointers, which are strings that reference specific locations within a JSON document. This package allows you to get, set, and remove values in JSON objects using these pointers.

What are json-pointer'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('json-pointer');
const obj = { foo: { bar: 'baz' } };
const value = jsonPointer.get(obj, '/foo/bar');
console.log(value); // Output: '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('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.set(obj, '/foo/bar', 'qux');
console.log(obj); // Output: { foo: { bar: 'qux' } }

Remove Value

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

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.remove(obj, '/foo/bar');
console.log(obj); // Output: { foo: {} }

Other packages similar to json-pointer

FAQs

Package last updated on 08 Sep 2013

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc