
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
json-pointer
Advanced tools
Some utilities for JSON pointers described by RFC 6901
Provides some additional stuff i needed but is not included in node-jsonpointer
$ npm install json-pointer
var pointer = require('json-pointer');
Looks up a JSON pointer in an object.
Array of reference tokens, e.g. returned by api.parse, can be passed as a pointer to .get, .set and .remove methods.
var obj = {
example: {
bla: 'hello'
}
};
pointer.get(obj, '/example/bla');
Sets a new value on object at the location described by pointer.
var obj = {};
pointer.set(obj, '/example/bla', 'hello');
Removes an attribute of object referenced by pointer.
var obj = {
example: 'hello'
};
pointer.remove(obj, '/example');
// obj -> {}
Creates a dictionary object (pointer -> value).
var obj = {
hello: {bla: 'example'}
};
pointer.dict(obj);
// Returns:
// {
// '/hello/bla': 'example'
// }
Just like:
each(pointer.dict(obj), iterator);
Tests if an object has a value for a JSON pointer.
var obj = {
bla: 'hello'
};
pointer.has(obj, '/bla'); // -> true
pointer.has(obj, '/non/existing'); // -> false
Escapes a reference token.
pointer.escape('hello~bla'); // -> 'hello~0bla'
pointer.escape('hello/bla'); // -> 'hello~1bla'
Unescape a reference token.
pointer.unescape('hello~0bla'); // -> 'hello~bla'
pointer.unescape('hello~1bla'); // -> 'hello/bla'
Converts a JSON pointer into an array of reference tokens.
pointer.parse('/hello/bla'); // -> ['hello', 'bla']
Builds a json pointer from an array of reference tokens.
pointer.compile(['hello', 'bla']); // -> '/hello/bla'
Convenience wrapper around the api.
pointer(object) // bind object
pointer(object, pointer) // get
pointer(object, pointer, value) // set
The wrapper supports chainable object oriented style.
var obj = {anything: 'bla'};
var objPointer = pointer(obj);
objPointer.set('/example', 'bla').dict();
The jsonpath package provides a way to query JSON documents using JSONPath expressions, which are similar to XPath expressions for XML. Unlike json-pointer, which uses a simpler pointer syntax, jsonpath offers more complex querying capabilities, such as filtering and recursive searches.
The json-query package allows you to query JSON objects using a simple query language. It supports nested queries, filtering, and joins. Compared to json-pointer, json-query offers more advanced querying features but may be more complex to use for simple get/set operations.
Lodash is a utility library that provides a wide range of functions for manipulating JavaScript objects, including deep property access and modification. While it is not specifically focused on JSON Pointers, it offers similar functionality through methods like _.get, _.set, and _.unset.
FAQs
Some utilities for JSON pointers described by RFC 6901
The npm package json-pointer receives a total of 3,340,518 weekly downloads. As such, json-pointer popularity was classified as popular.
We found that json-pointer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.