Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

readme.md 983B

4 år sedan
12345678910111213141516171819202122232425262728293031323334
  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. > Check if your package was installed globally
  3. Can be useful if your CLI needs different behavior when installed globally and locally.
  4. ## Install
  5. ```
  6. $ npm install is-installed-globally
  7. ```
  8. ## Usage
  9. ```js
  10. const isInstalledGlobally = require('is-installed-globally');
  11. // With `npm install your-package`
  12. console.log(isInstalledGlobally);
  13. //=> false
  14. // With `npm install --global your-package`
  15. console.log(isInstalledGlobally);
  16. //=> true
  17. ```
  18. ## Related
  19. - [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
  20. - [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
  21. - [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries