Gathering detailed insights and metrics for global-modules-path
Gathering detailed insights and metrics for global-modules-path
Gathering detailed insights and metrics for global-modules-path
Gathering detailed insights and metrics for global-modules-path
global-modules
The directory used by npm for globally installed npm modules.
global-prefix
Get the npm global path prefix.
global-dirs
Get the directory of globally installed packages and binaries
resolve-dir
Resolve a directory that is either local, global or in the user's home directory.
Returns path to globally installed package
npm install global-modules-path
Typescript
Module System
Node Version
NPM Version
99.4
Supply Chain
76.5
Quality
79.5
Maintenance
100
Vulnerability
100
License
JavaScript (98.64%)
Shell (0.69%)
Batchfile (0.66%)
Total Downloads
91,549,499
Last Day
1,814
Last Week
50,823
Last Month
225,661
Last Year
3,099,814
Apache-2.0 License
1 Stars
40 Commits
2 Forks
2 Watchers
3 Branches
4 Contributors
Updated on Jan 04, 2023
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
global-modules-path@3.0.0
Unpacked Size
20.86 kB
Size
6.95 kB
File Count
5
NPM Version
6.14.15
Node Version
14.18.1
Published on
Jan 08, 2023
Cumulative downloads
Total Downloads
Last Day
0.3%
1,814
Compared to previous day
Last Week
5.3%
50,823
Compared to previous week
Last Month
5.2%
225,661
Compared to previous month
Last Year
-30.9%
3,099,814
Compared to previous year
5
Returns path to globally installed package.
In order to use this package you need:
npm --version
from your default terminal).The module has a single public method called getPath
. It requires at least one argument - the name of the globally installed package that you need.
In case the package is not installed, getPath
will return null.
getPath
will throw error in case the OS is NOT supported. Supported OS are:
process.platform
returns win32
)process.platform
returns darwin
)process.platform
returns linux
)Example:
let pathToPackage = require("global-modules-path").getPath("packageName");
The method returns the path to globally installed package or null. The code constructs the path based on the result of npm config get prefix
and checks if the package exists.
Example:
let pathToPackage = require("global-modules-path").getPath("packageName", "executableName");
The method returns the path to globally installed package or null. The code constructs the path based on the result of npm config get prefix
and checks if the package exists. In case the package cannot be found in this way, the executableName
is used to determine if the package is globally installed.
where executableName
command and parses the result.ls -l executableName
and which executableName
and parses the results.NOTE: In some cases the executable name is not the same as the package name.
9.8/10
Summary
global-modules-path Command Injection vulnerability
Affected Versions
< 3.0.0
Patched Versions
3.0.0
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 3/13 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
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
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Score
Last Scanned on 2025-06-23
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