{"_id":"global-directory","_rev":"3212395","name":"global-directory","description":"Get the directory of globally installed packages and binaries","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-02-22T02:25:44.000Z","created":"2023-11-06T15:42:07.969Z","4.0.1":"2023-11-06T15:44:04.954Z","4.0.0":"2023-11-06T15:42:07.969Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/global-directory.git"},"versions":{"4.0.1":{"name":"global-directory","version":"4.0.1","description":"Get the directory of globally installed packages and binaries","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/global-directory.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["global","prefix","path","paths","npm","yarn","node","modules","node-modules","package","packages","binary","binaries","bin","directory","directories","npmrc","rc","config","root","resolve"],"dependencies":{"ini":"4.1.1"},"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"df9fdcd383faf601d16e855f281d131270717c33","bugs":{"url":"https://github.com/sindresorhus/global-directory/issues"},"homepage":"https://github.com/sindresorhus/global-directory#readme","_id":"global-directory@4.0.1","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"4d7ac7cfd2cb73f304c53b8810891748df5e361e","size":2876,"noattachment":false,"key":"/global-directory/-/global-directory-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-directory/download/global-directory-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-directory_4.0.1_1699285444811_0.2563203949199935"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-06T15:44:04.954Z","publish_time":1699285444954,"_source_registry_name":"default","_cnpm_publish_time":1699285444954},"4.0.0":{"name":"global-directory","version":"4.0.0","description":"Get the directory of globally installed packages and binaries","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/global-directory.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["global","prefix","path","paths","npm","yarn","node","modules","node-modules","package","packages","binary","binaries","bin","directory","directories","npmrc","rc","config","root","resolve"],"dependencies":{"ini":"4.1.1"},"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"695dc057789d08fcb5c820d4b3669e52dc72779b","bugs":{"url":"https://github.com/sindresorhus/global-directory/issues"},"homepage":"https://github.com/sindresorhus/global-directory#readme","_id":"global-directory@4.0.0","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"8078838682ddf95d1a17265a6b208bf5570a302b","size":2877,"noattachment":false,"key":"/global-directory/-/global-directory-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/global-directory/download/global-directory-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-directory_4.0.0_1699285327792_0.31894163192859804"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-06T15:42:07.969Z","publish_time":1699285327969,"_source_registry_name":"default","_cnpm_publish_time":1699285327969}},"readme":"# global-directory\n\n> Get the directory of globally installed packages and binaries\n\nUses the same resolution logic as `npm` and `yarn`.\n\n## Install\n\n```sh\nnpm install global-directory\n```\n\n## Usage\n\n```js\nimport globalDirectory from 'global-directory';\n\nconsole.log(globalDirectory.npm.prefix);\n//=> '/usr/local'\n\nconsole.log(globalDirectory.npm.packages);\n//=> '/usr/local/lib/node_modules'\n\nconsole.log(globalDirectory.npm.binaries);\n//=> '/usr/local/bin'\n\nconsole.log(globalDirectory.yarn.packages);\n//=> '/Users/sindresorhus/.config/yarn/global/node_modules'\n```\n\n## API\n\n### globalDirectory\n\n#### npm\n#### yarn\n\n##### packages\n\nThe directory with globally installed packages.\n\nEquivalent to `npm root --global`.\n\n##### binaries\n\nThe directory with globally installed binaries.\n\nEquivalent to `npm bin --global`.\n\n##### prefix\n\nThe directory with directories for packages and binaries. You probably want either of the above.\n\nEquivalent to `npm prefix --global`.\n\n## Related\n\n- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module\n- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module\n- [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally\n","_attachments":{},"homepage":"https://github.com/sindresorhus/global-directory#readme","bugs":{"url":"https://github.com/sindresorhus/global-directory/issues"},"license":"MIT"}