Gathering detailed insights and metrics for jsonuri
Gathering detailed insights and metrics for jsonuri
Gathering detailed insights and metrics for jsonuri
Gathering detailed insights and metrics for jsonuri
npm install jsonuri
Typescript
Module System
Node Version
NPM Version
TypeScript (53.47%)
HTML (43.13%)
JavaScript (2.75%)
Shell (0.64%)
Total Downloads
131,203
Last Day
43
Last Week
265
Last Month
1,434
Last Year
23,458
MIT License
156 Stars
86 Commits
17 Forks
4 Watchers
10 Branches
6 Contributors
Updated on Apr 29, 2025
Minified
Minified + Gzipped
Latest Version
3.4.5
Package Id
jsonuri@3.4.5
Unpacked Size
41.87 kB
Size
11.44 kB
File Count
22
NPM Version
10.5.0
Node Version
20.12.2
Published on
May 06, 2024
Cumulative downloads
Total Downloads
1
21
Use URI style methods to operate data.
All operations friendly support Vue-like frameworks.
1$ npm install jsonuri --save
1import * as jsonuri from 'jsonuri' 2// or 3import { get, set, ... } from 'jsonuri' // recommended practice, friendly to tree-shaking
1{ 2 "menu": { 3 "id": 123, 4 "list": [0, 1, 2, 3, 4], 5 "popup": { 6 "menuitem": [{ 7 "value": "New", 8 "onclick": "CreateNewDoc()" 9 }, 10 { 11 "value": "Open", 12 "onclick": "OpenDoc()" 13 }, 14 { 15 "value": "Close", 16 "onclick": "CloseDoc()" 17 } 18 ] 19 } 20 } 21} 22
Get the value of the specified data for the path.
Example:
1jsonuri.get(data, 'menu/id') 2// return 123 3 4jsonuri.get(data, 'menu/popup/menuitem/0/value') 5// return 'New' 6 7jsonuri.get(data, 'menu/popup/menuitem/0/value/..') 8// {value: "New", onclick: "CreateNewDoc()"} 9
Set the value of the specified data for the path.
Example:
1jsonuri.set(data, 'menu/id/', 789) 2jsonuri.get(data, 'menu/id') 3//789 4
Remove the value of the specified data for the path.
Example:
1jsonuri.rm(data, 'menu/id') 2jsonuri.get(data, 'menu/id') // undefined
Data A moved to target B before or after.
Example:
1jsonuri.mv(data, 'menu/list/0', 'menu/list/3') 2jsonuri.get(data, 'menu/list') // [1, 2, 3, 0, 4] 3[see more](test/spec/mv_spec.js) 4 5 6jsonuri.set(data, 'menu/list/',[0,1,2,3,4]) 7jsonuri.mv(data, 'menu/list/0', 'menu/list/3', 'before') 8jsonuri.get(data, 'menu/list') // [1, 2, 0, 3, 4] 9
Data swap in an array.
Example:
1jsonuri.swap(data, 'menu/list/0', 'menu/list/4') 2jsonuri.get(data, 'menu/list') // [4, 1, 2, 3, 0] 3 4jsonuri.swap(data, 'menu/list/0', 'menu/list/4') 5jsonuri.get(data, 'menu/list') // [4, 1, 2, 3, 0] 6
Insert data into an array
that is described in the path.
Example:
1jsonuri.insert(data, 'menu/list/0', 9999, 'before') // [9999, 0, 1, 2, 3, 4] 2
Traverse each data of each node and value.
Example:
1jsonuri.walk({a:{a1:'x'}}, (value, key, parent, { path }) => { 2 console.log(value, key, parent, path) 3}) 4 5// { a1: 'x' } 'a' { a: { a1: 'x' } } 'a' 6// x a1 { a1: 'x' } 'a/a1'
Example:
1jsonuri.normalizePath('a', 'b') // a/b 2 3jsonuri.normalizePath(['a', 'b', '../'], 'c') // a/c 4 5
Example:
1jsonuri.isCircular({}) // return false 2jsonuri.isCircular(window) // return true 3 4var a = {} 5jsonuri.set(a, '/b/c/d/e/f/g', a) 6jsonuri.isCircular(a) // return true 7 8
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-05-05
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 MoreLast Day
13.2%
43
Compared to previous day
Last Week
30.5%
265
Compared to previous week
Last Month
-51.7%
1,434
Compared to previous month
Last Year
-41.1%
23,458
Compared to previous year