chrisdrakeford 9c87c1307d first commit | 3 роки тому | |
---|---|---|
.. | ||
index.d.ts | 3 роки тому | |
index.js | 3 роки тому | |
license | 3 роки тому | |
package.json | 3 роки тому | |
readme.md | 3 роки тому |
Get the directory of globally installed packages and binaries
Uses the same resolution logic as npm
and yarn
.
$ npm install global-dirs
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'
Directory with globally installed packages.
Equivalent to npm root --global
.
Directory with globally installed binaries.
Equivalent to npm bin --global
.
Directory with directories for packages and binaries. You probably want either of the above.
Equivalent to npm prefix --global
.