• Home
Name Date Size #Lines LOC

..--

index.jsD12-May-2024226 64

licenseD12-May-20241.1 KiB105

package.jsonD12-May-20241.9 KiB8180

readme.mdD12-May-20241 KiB4023

readme.md

1# is-installed-globally [![Build Status](https://travis-ci.org/sindresorhus/is-installed-globally.svg?branch=master)](https://travis-ci.org/sindresorhus/is-installed-globally)
2
3> Check if your package was installed globally
4
5Can be useful if your CLI needs different behavior when installed globally and locally.
6
7
8## Install
9
10```
11$ npm install is-installed-globally
12```
13
14
15## Usage
16
17```js
18const isInstalledGlobally = require('is-installed-globally');
19
20// With `npm install your-package`
21console.log(isInstalledGlobally);
22//=> false
23
24// With `npm install --global your-package`
25console.log(isInstalledGlobally);
26//=> true
27```
28
29
30## Related
31
32- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
33- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
34- [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries
35
36
37## License
38
39MIT © [Sindre Sorhus](https://sindresorhus.com)
40