Some utilities for the JSON pointers described by RFC 6901
Installations
npm install json-pointer
Score
99.8
Supply Chain
99.5
Quality
78
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
manuelstofer
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
No
Node Version
14.17.0
NPM Version
6.14.13
Statistics
178 Stars
93 Commits
42 Forks
4 Watching
7 Branches
12 Contributors
Updated on 08 Nov 2024
Bundle Size
2.33 kB
Minified
1.05 kB
Minified + Gzipped
Languages
JavaScript (95.92%)
HTML (2.87%)
Makefile (1.21%)
Total Downloads
Cumulative downloads
Total Downloads
142,065,397
Last day
-37.6%
206,374
Compared to previous day
Last week
-8.4%
1,534,147
Compared to previous week
Last month
-2.6%
6,826,755
Compared to previous month
Last year
75.9%
56,778,160
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
json-pointer
Some utilities for JSON pointers described by RFC 6901
Provides some additional stuff i needed but is not included in node-jsonpointer
Installation
1$ npm install json-pointer
API
1var pointer = require('json-pointer');
.get(object, 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.
1var obj = { 2 example: { 3 bla: 'hello' 4 } 5}; 6pointer.get(obj, '/example/bla');
.set(object, pointer, value)
Sets a new value on object at the location described by pointer.
1var obj = {}; 2pointer.set(obj, '/example/bla', 'hello');
.remove(object, pointer)
Removes an attribute of object referenced by pointer.
1var obj = { 2 example: 'hello' 3}; 4pointer.remove(obj, '/example'); 5// obj -> {}
.dict(object)
Creates a dictionary object (pointer -> value).
1var obj = { 2 hello: {bla: 'example'} 3}; 4pointer.dict(obj); 5 6// Returns: 7// { 8// '/hello/bla': 'example' 9// }
.walk(object, iterator)
Just like:
1each(pointer.dict(obj), iterator);
.has(object, pointer)
Tests if an object has a value for a JSON pointer.
1var obj = { 2 bla: 'hello' 3}; 4 5pointer.has(obj, '/bla'); // -> true 6pointer.has(obj, '/non/existing'); // -> false
.escape(str)
Escapes a reference token.
1pointer.escape('hello~bla'); // -> 'hello~0bla' 2pointer.escape('hello/bla'); // -> 'hello~1bla'
.unescape(str)
Unescape a reference token.
1pointer.unescape('hello~0bla'); // -> 'hello~bla' 2pointer.unescape('hello~1bla'); // -> 'hello/bla'
.parse(str)
Converts a JSON pointer into an array of reference tokens.
1pointer.parse('/hello/bla'); // -> ['hello', 'bla']
.compile(array)
Builds a json pointer from an array of reference tokens.
1pointer.compile(['hello', 'bla']); // -> '/hello/bla'
pointer(object, [pointer, [value]])
Convenience wrapper around the api.
1pointer(object) // bind object 2pointer(object, pointer) // get 3pointer(object, pointer, value) // set
The wrapper supports chainable object oriented style.
1var obj = {anything: 'bla'}; 2var objPointer = pointer(obj); 3objPointer.set('/example', 'bla').dict();
Stable Version
The latest stable version of the package.
Stable Version
0.6.2
CRITICAL
1
9.8/10
Summary
json-pointer vulnerable to Prototype Pollution
Affected Versions
< 0.6.2
Patched Versions
0.6.2
MODERATE
2
5.6/10
Summary
Prototype Pollution in json-pointer
Affected Versions
<= 0.6.1
Patched Versions
0.6.2
6/10
Summary
Prototype pollution in json-pointer
Affected Versions
< 0.6.1
Patched Versions
0.6.1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 6/19 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Reason
50 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-3fx5-fwvr-xrjg
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.5
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to json-pointer
@types/json-pointer
TypeScript definitions for json-pointer
@swagger-api/apidom-json-pointer
Evaluate JSON Pointer expressions against ApiDOM.
@hyperjump/json-pointer
An RFC-6901 JSON Pointer implementation
@sagold/json-pointer
json pointer - failsafe data retrieval from js and json objects