Gathering detailed insights and metrics for parent-package-json
Gathering detailed insights and metrics for parent-package-json
Gathering detailed insights and metrics for parent-package-json
Gathering detailed insights and metrics for parent-package-json
npm install parent-package-json
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
6 Stars
88 Commits
2 Forks
2 Watching
19 Branches
3 Contributors
Updated on 17 Oct 2023
Minified
Minified + Gzipped
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-24.9%
730
Compared to previous day
Last week
-8.4%
4,782
Compared to previous week
Last month
-0.7%
23,422
Compared to previous month
Last year
-23.1%
560,567
Compared to previous year
4
Find, read and parse the package.json
that sits above your module. Provide a custom ignore count or start path to define where to look for a parent package.
1npm install --save parent-package-json
1import parentJSON from "parent-package-json";
To get the nearest parent package.json
s path, content (as string) or parsed content (using JSON.parse):
1const parent = parentJSON(); 2 3const pathToParentPackageJSON = parent.path.relative; 4const parentContentAsString = parent.read(); 5const parentContentAsObject = parent.parse(); 6 7const parentVersion = parentContentAsObject.version;
The parent package.json
is looked up starting from the current working directory of your script. If none is found, paths, .read()
and .parse()
will return undefined
.
If you need to determine the parent package.json
of a custom path instead of the current working directory, which should be the module from which you are running the code, you can specify it via the path
option:
1const startPath = path.join(...); 2const parent = parent({ startPath });
You can also specify a count of parent directories to skip:
1const parent = parent({ ignoreCount: 1 });
Note: A package.json
file in the provided startPath
is always ignored. Set the startPath
one layer below the one where you expect to find a parent package file.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
8 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/16 approved changesets -- 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
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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