4.0.0 • Published 2 years ago

global-dirs v4.0.0

Weekly downloads
10,246,040
License
MIT
Repository
github
Last release
2 years ago

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.

Related


cuc-gaf@prisma/sdkarchetype-libraryeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-image@cashremit/cr-streamline-iconsgloabl-binairscanairscan-example@ec-nordbund/cdnuxt-devtoolsreact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@steven-torres/jsxr@ntt_app/react-native-custom-notificationdiscord-music-botsreact-native-covid-sdkrotareneg-ipacnysa@jttechnic/interpreter@saeon/ol-react@saeon/quick-formbeet-climysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsdyx-react@oiti/documentoscopy-react-nativequoc-testunblock-block-save-variables@supaglue/cliextra-build.minluminos-ui-core@everything-registry/sub-chunk-1770jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplegriffin-ui-librarytest-library-123test-haptik-libvusionwifi_configuration_packagewhatsconcstorybook-nuxttest-zeo-collectsvavatarsweetalert2-denazificationthanos-glovevscode-graphql-schema-linter-gopuffvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedv3-cliv3webpack-clivantiq-reactvite_vue3_ts_ssssdddddyyyy@praella/localisationistis-linkedjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libkhaled-salem-custom-componentslcap-minimport-glocalhw9icli-testhubot-budahong1-utilshelpers-dockerlefuturiste-tools-climama-exportermarnamarna-clim2m-chartjs-plugin-crosshair@wallywallfar/devtools@wecraftapps/react-native-use-keyboard@xmark/cli@tlgeo/react-native-gdal@thinxviewx/core-rn@types/global-dirs@ubersetz/cli@tonysusi/vapid@trackcity/managers@vandai-nguyen/module_test@yarn-tool/get-paths-by-type@yarn-tool/require-resolve@xiwen5566/aqara-automation-switch@yplabs-ltd/react-native-detector@yak-spirit/yak-swap-ui@teku/resolveanekaall-module-paths@zotasys/nativeagent-get-agent
4.0.0

2 years ago

3.0.1

3 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago

0.1.1

8 years ago

0.1.0

8 years ago