Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

global-dirs

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Issues
File Explorer

Advanced tools

global-dirs

Get the directory of globally installed packages and binaries

    3.0.1latest
    Github

Version published
Maintainers
1
Weekly downloads
14,776,298
increased by7.75%

Weekly downloads

Readme

Source

global-dirs

Get the directory of globally installed packages and binaries

Uses the same resolution logic as npm and yarn.

Install

$ npm install global-dirs

Usage

const globalDirectories = require('global-dirs'); console.log(globalDirectories.npm.prefix); //=> '/usr/local' console.log(globalDirectories.npm.packages); //=> '/usr/local/lib/node_modules' console.log(globalDirectories.npm.binaries); //=> '/usr/local/bin' console.log(globalDirectories.yarn.packages); //=> '/Users/sindresorhus/.config/yarn/global/node_modules'

API

globalDirectories

npm
yarn
packages

Directory with globally installed packages.

Equivalent to npm root --global.

binaries

Directory with globally installed binaries.

Equivalent to npm bin --global.

prefix

Directory with directories for packages and binaries. You probably want either of the above.

Equivalent to npm prefix --global.

  • import-global - Import a globally installed module
  • resolve-global - Resolve the path of a globally installed module
  • is-installed-globally - Check if your package was installed globally

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is global-dirs?

Get the directory of globally installed packages and binaries

Is global-dirs popular?

The npm package global-dirs receives a total of 14,151,101 weekly downloads. As such, global-dirs popularity was classified as popular.

Is global-dirs well maintained?

We found that global-dirs 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.

Last updated on 16 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc