Gathering detailed insights and metrics for doc-path
Gathering detailed insights and metrics for doc-path
Gathering detailed insights and metrics for doc-path
Gathering detailed insights and metrics for doc-path
add-doc-route
add-doc-route, a simple way to add OpenAPI documentation to your express app, you simply need to add path to YAML file of your OpenAPI spec and you're good to go
markdown-doc-bundler
Accepts the path of a directory. Produces an object containing the contents of markdown files as strings organized according to the directory's original structure.
@mineko-io/lambda-edge-root-doc
Will define root doc for lambda@edge based on given path
@crikey/json-private-pointer
Functions for handling JSON pointers [rfc6901](https://www.rfc-editor.org/rfc/rfc6901.html) and [relative-json-pointer](https://datatracker.ietf.org/doc/html/draft-luff-relative-json-pointer-00), with an additional extension for marking path segments as "
npm install doc-path
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
100
Quality
77
Maintenance
100
Vulnerability
100
License
TypeScript (93.91%)
JavaScript (6.09%)
Total Downloads
46,652,411
Last Day
30,404
Last Week
540,587
Last Month
2,276,397
Last Year
22,121,469
4 Stars
115 Commits
2 Forks
1 Watchers
1 Branches
2 Contributors
Updated on Jul 13, 2024
Minified
Minified + Gzipped
Latest Version
4.1.2
Package Id
doc-path@4.1.2
Unpacked Size
11.82 kB
Size
3.82 kB
File Count
4
NPM Version
10.7.0
Node Version
20.15.0
Published on
Jul 13, 2024
Cumulative downloads
Total Downloads
Last Day
9%
30,404
Compared to previous day
Last Week
-8.7%
540,587
Compared to previous week
Last Month
13.9%
2,276,397
Compared to previous month
Last Year
127.1%
22,121,469
Compared to previous year
This module will take paths in documents which can include nested paths specified by '.'s and can evaluate the path to a value, or can set the value at that path depending on the function called.
1$ npm install doc-path
1let path = require('doc-path');
document
- Object
- A JSON document that will be iterated over.key
- String
- A path to the existing key whose value will be returned.
a.b
) then be sure to escape the dot with a blackslash (eg. a\\.b
).If the key does not exist, undefined
is returned.
If the object's structure is extremely deep, then an error may be thrown if the maximum call stack size is exceeded while traversing the object.
1const path = require('doc-path'); 2 3let document = { 4 Make: 'Nissan', 5 Model: 'Murano', 6 Year: '2013', 7 Specifications: { 8 Mileage: '7106', 9 Trim: 'S AWD' 10 }, 11 Features: [ 12 { 13 feature: 'A/C', 14 packages: [ 15 {name: 'Base'}, 16 {name: 'Premium'} 17 ] 18 }, 19 { 20 feature: 'Radio', 21 packages: [ 22 {name: 'Convenience'}, 23 {name: 'Premium'} 24 ] 25 } 26 ] 27}; 28 29console.log(path.evaluatePath(document, 'Make')); 30// => 'Nissan' 31 32console.log(path.evaluatePath(document, 'Specifications.Mileage')); 33// => '7106' 34 35console.log(path.evaluatePath(document, 'Features.feature')); 36// => [ 'A/C', 'Radio' ] 37 38console.log(path.evaluatePath(document, 'Features.packages.name')); 39// => [ ['Base', 'Premium'], ['Convenience', 'Premium'] ]
document
- Object
- A JSON document that will be iterated over.key
- String
- A path to the existing key whose value will be set.
a.b
) then be sure to escape the dot with a blackslash (eg. a\\.b
).value
- *
- The value that will be set at the given key.If the key does not exist, then the object will be built up to have that path. If no document is provided, an error will be thrown. If the object's structure is extremely deep, then an error may be thrown if the maximum call stack size is exceeded while traversing the object.
1const path = require('doc-path'); 2 3let document = { 4 Make: 'Nissan', 5 Features: [ 6 { feature: 'A/C' } 7 ] 8}; 9 10console.log(path.setPath(document, 'Color.Interior', 'Tan')); 11/* 12 { 13 Make: 'Nissan', 14 Features: [ 15 { feature: 'A/C' } 16 ] 17 Color: { 18 Interior: 'Tan' 19 } 20 } 21*/ 22 23console.log(path.setPath(document, 'StockNumber', '34567')); 24/* 25 { 26 Make: 'Nissan', 27 Features: [ 28 { feature: 'A/C' } 29 ] 30 Color: { 31 Interior: 'Tan' 32 }, 33 StockNumber: '34567' 34 } 35*/ 36 37console.log(path.setPath(document, 'Features.cost', '$0 (Standard)')); 38 /* 39 { 40 Make: 'Nissan', 41 Features: [ 42 { 43 feature: 'A/C', 44 cost: '$0 (Standard)' 45 } 46 ] 47 Color: { 48 Interior: 'Tan' 49 }, 50 StockNumber: '34567' 51 } 52 */
1$ npm test
Note: This requires mocha
, should
, async
, and underscore
.
To see test coverage, please run:
1$ npm run coverage
Current Coverage is:
Statements : 100% ( 33/33 )
Branches : 100% ( 24/24 )
Functions : 100% ( 3/3 )
Lines : 100% ( 29/29 )
.
characters (as of v3.0.0)9.8/10
Summary
Prototype Pollution in doc-path
Affected Versions
< 2.1.2
Patched Versions
2.1.2
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
6 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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 More