Installations
npm install @woifes/gjson
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.18.2
NPM Version
9.8.1
Score
72.1
Supply Chain
87.5
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (99.46%)
JavaScript (0.29%)
Dockerfile (0.25%)
Developer
woifes
Download Statistics
Total Downloads
395
Last Day
1
Last Week
4
Last Month
12
Last Year
296
GitHub Statistics
165 Commits
1 Watching
2 Branches
1 Contributors
Bundle Size
3.89 kB
Minified
1.29 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.1.0
Package Id
@woifes/gjson@0.1.0
Unpacked Size
29.98 kB
Size
8.00 kB
File Count
27
NPM Version
9.8.1
Node Version
18.18.2
Publised On
28 Nov 2023
Total Downloads
Cumulative downloads
Total Downloads
395
Last day
0%
1
Compared to previous day
Last week
100%
4
Compared to previous week
Last month
-53.8%
12
Compared to previous month
Last year
199%
296
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@woifes/gjson
Why?
This package implements the GSJON json document search. The focus lies on the search aspect of GJSON because even though NodeJS comes with a good build-in JSON support. It misses a commong searching syntax.
Please check the source code before using this package
Installation
1npm install @woifes/gjson
Quick start
1import { get } from "@woifes/gjson"; 2 3const exampleJson = { 4 name: { first: "Tom", last: "Anderson" }, 5 age: 37, 6 children: ["Sara", "Alex", "Jack"], 7 "fav.movie": "Deer Hunter", 8 friends: [ 9 { first: "Dale", last: "Murphy", age: 44, nets: ["ig", "fb", "tw"] }, 10 { first: "Roger", last: "Craig", age: 68, nets: ["fb", "tw"] }, 11 { first: "Jane", last: "Murphy", age: 47, nets: ["ig", "tw"] }, 12 ], 13}; 14 15console.log( get(exampleJson, "name.first") ); //"Tom"
Supported GJSON features
GSJON feature | Supported? | Notes |
---|---|---|
Path Structure | YES | |
Basic | YES | |
Wildcards | YES | |
Escape Character | YES | |
Arrays | YES | |
Queries | YES | |
Dot vs Pipe | YES | |
Modifiers | NO | |
Modifier arguments | NO | |
Custom modifiers | NO | |
Multipaths | NO | |
Literals | NO | |
JSON Lines | NO |
This table is taken from the docs of gjson-py
Running the build
The project is part of a monorepo. If the project is checked out in this environment use the following scripts:
TypeScript build:
1pnpm run compile
Run tests:
1pnpm test
No vulnerabilities found.
No security vulnerabilities found.