
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
@types/json-pointer
Advanced tools
@types/json-pointer provides TypeScript type definitions for the json-pointer library, which allows you to manipulate JSON data using JSON Pointers as defined in RFC 6901.
Get a value from a JSON object using a JSON Pointer
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); // 'baz'
Set a value in a JSON object using a JSON Pointer
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.foo.bar); // 'qux'
Remove a value from a JSON object using a JSON Pointer
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.foo.bar); // undefined
Create a JSON Pointer from an array of tokens
This feature allows you to create a JSON Pointer string from an array of tokens.
const jsonPointer = require('json-pointer');
const pointer = jsonPointer.compile(['foo', 'bar']);
console.log(pointer); // '/foo/bar'
Parse a JSON Pointer into an array of tokens
This feature allows you to parse a JSON Pointer string into an array of tokens.
const jsonPointer = require('json-pointer');
const tokens = jsonPointer.parse('/foo/bar');
console.log(tokens); // ['foo', 'bar']
jsonpath is a query language for JSON, similar to XPath for XML. It allows for more complex queries and manipulations compared to json-pointer, which is more straightforward and adheres strictly to the JSON Pointer specification.
json-query allows for querying and manipulating JSON data using a simple query language. It provides more flexibility and functionality compared to json-pointer, which is more focused on the JSON Pointer standard.
json-ptr is another library for JSON Pointer operations. It offers similar functionalities to json-pointer but with a different API design. It also provides additional features like pointer validation.
npm install --save @types/json-pointer
This package contains type definitions for json-pointer 1.0 l (https://www.npmjs.org/package/json-pointer).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/json-pointer
Additional Details
These definitions were written by Bart van der Schoor https://github.com/Bartvds.
FAQs
TypeScript definitions for json-pointer
The npm package @types/json-pointer receives a total of 301,467 weekly downloads. As such, @types/json-pointer popularity was classified as popular.
We found that @types/json-pointer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.