Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
global-directory
Advanced tools
Readme
Get the directory of globally installed packages and binaries
Uses the same resolution logic as npm
and yarn
.
npm install global-directory
import globalDirectory from 'global-directory';
console.log(globalDirectory.npm.prefix);
//=> '/usr/local'
console.log(globalDirectory.npm.packages);
//=> '/usr/local/lib/node_modules'
console.log(globalDirectory.npm.binaries);
//=> '/usr/local/bin'
console.log(globalDirectory.yarn.packages);
//=> '/Users/sindresorhus/.config/yarn/global/node_modules'
The directory with globally installed packages.
Equivalent to npm root --global
.
The directory with globally installed binaries.
Equivalent to npm bin --global
.
The directory with directories for packages and binaries. You probably want either of the above.
Equivalent to npm prefix --global
.
FAQs
Get the directory of globally installed packages and binaries
The npm package global-directory receives a total of 1,142,169 weekly downloads. As such, global-directory popularity was classified as popular.
We found that global-directory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.