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

@sagold/json-pointer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sagold/json-pointer

json pointer - failsafe data retrieval from js and json objects

  • 6.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
138K
increased by16.97%
Maintainers
1
Weekly downloads
 
Created

What is @sagold/json-pointer?

@sagold/json-pointer is a lightweight library for handling JSON Pointers as defined in RFC 6901. It allows you to easily get, set, and delete values within a JSON document using a string syntax.

What are @sagold/json-pointer's main functionalities?

Get Value

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

const jsonPointer = require('@sagold/json-pointer');
const document = { foo: { bar: 'baz' } };
const value = jsonPointer.get(document, '/foo/bar');
console.log(value); // Output: 'baz'

Set Value

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

const jsonPointer = require('@sagold/json-pointer');
const document = { foo: { bar: 'baz' } };
jsonPointer.set(document, '/foo/bar', 'new value');
console.log(document); // Output: { foo: { bar: 'new value' } }

Delete Value

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

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

Other packages similar to @sagold/json-pointer

Keywords

FAQs

Package last updated on 06 Apr 2024

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