.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / global-dirs / readme.md
1 # global-dirs [![Build Status](https://travis-ci.org/sindresorhus/global-dirs.svg?branch=master)](https://travis-ci.org/sindresorhus/global-dirs)
2
3 > Get the directory of globally installed packages and binaries
4
5 Uses the same resolution logic as `npm` and `yarn`.
6
7
8 ## Install
9
10 ```
11 $ npm install global-dirs
12 ```
13
14
15 ## Usage
16
17 ```js
18 const globalDirs = require('global-dirs');
19
20 console.log(globalDirs.npm.prefix);
21 //=> '/usr/local'
22
23 console.log(globalDirs.npm.packages);
24 //=> '/usr/local/lib/node_modules'
25
26 console.log(globalDirs.npm.binaries);
27 //=> '/usr/local/bin'
28
29 console.log(globalDirs.yarn.packages);
30 //=> '/Users/sindresorhus/.config/yarn/global/node_modules'
31 ```
32
33
34 ## API
35
36 ### globalDirs
37
38 #### npm
39 #### yarn
40
41 ##### packages
42
43 Directory with globally installed packages.
44
45 Equivalent to `npm root --global`.
46
47 ##### binaries
48
49 Directory with globally installed binaries.
50
51 Equivalent to `npm bin --global`.
52
53 ##### prefix
54
55 Directory with directories for packages and binaries. You probably want either of the above.
56
57 Equivalent to `npm prefix --global`.
58
59
60 ## Related
61
62 - [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
63 - [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
64 - [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally
65
66
67 ## License
68
69 MIT © [Sindre Sorhus](https://sindresorhus.com)