Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
index.js | D | 12-May-2024 | 226 | 6 | 4 | |
license | D | 12-May-2024 | 1.1 KiB | 10 | 5 | |
package.json | D | 12-May-2024 | 1.9 KiB | 81 | 80 | |
readme.md | D | 12-May-2024 | 1 KiB | 40 | 23 |
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