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
JavaScript (98.64%)
Shell (0.69%)
Batchfile (0.66%)
Total Downloads
90,664,990
Last Day
13,020
Last Week
44,249
Last Month
201,735
Last Year
3,254,041
1 Stars
40 Commits
2 Forks
3 Watching
3 Branches
4 Contributors
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
Publised On
08 Jan 2023
Cumulative downloads
Total Downloads
Last day
51%
13,020
Compared to previous day
Last week
-0.4%
44,249
Compared to previous week
Last month
14.1%
201,735
Compared to previous month
Last year
-43.3%
3,254,041
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.
Stable Version
1
9.8/10
Summary
global-modules-path Command Injection vulnerability
Affected Versions
< 3.0.0
Patched Versions
3.0.0
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
4 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
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Score
Last Scanned on 2025-01-27
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