You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.4 KiB

4 years ago
  1. # global-prefix [![NPM version](https://img.shields.io/npm/v/global-prefix.svg?style=flat)](https://www.npmjs.com/package/global-prefix) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![NPM total downloads](https://img.shields.io/npm/dt/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/global-prefix.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/global-prefix) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/global-prefix.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/global-prefix)
  2. > Get the npm global path prefix.
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/):
  5. ```sh
  6. $ npm install --save global-prefix
  7. ```
  8. This is partially based on the code used by npm internally to resolve the global prefix.
  9. ## Usage
  10. ```js
  11. var prefix = require('global-prefix');
  12. //=> '/usr/local' (this path will differ by system and user-defined config)
  13. ```
  14. ## About
  15. ### Related projects
  16. * [global-modules](https://www.npmjs.com/package/global-modules): The directory used by npm for globally installed npm modules. | [homepage](https://github.com/jonschlinkert/global-modules "The directory used by npm for globally installed npm modules.")
  17. * [global-paths](https://www.npmjs.com/package/global-paths): Returns an array of unique "global" directories based on the user's platform and environment. The… [more](https://github.com/jonschlinkert/global-paths) | [homepage](https://github.com/jonschlinkert/global-paths "Returns an array of unique "global" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.")
  18. ### Contributing
  19. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
  20. ### Contributors
  21. | **Commits** | **Contributor** |
  22. | --- | --- |
  23. | 16 | [jonschlinkert](https://github.com/jonschlinkert) |
  24. | 15 | [doowb](https://github.com/doowb) |
  25. | 1 | [rmbaad](https://github.com/rmbaad) |
  26. | 1 | [avengerpenguin](https://github.com/avengerpenguin) |
  27. | 1 | [jason-chang](https://github.com/jason-chang) |
  28. | 1 | [jorrit](https://github.com/jorrit) |
  29. | 1 | [mathiasvr](https://github.com/mathiasvr) |
  30. | 1 | [tunnckoCore](https://github.com/tunnckoCore) |
  31. ### Building docs
  32. _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
  33. To generate the readme, run the following command:
  34. ```sh
  35. $ npm install -g verbose/verb#dev verb-generate-readme && verb
  36. ```
  37. ### Running tests
  38. Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
  39. ```sh
  40. $ npm install && npm test
  41. ```
  42. ### Author
  43. **Jon Schlinkert**
  44. * [github/jonschlinkert](https://github.com/jonschlinkert)
  45. * [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
  46. ### License
  47. Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
  48. Released under the [MIT License](LICENSE).
  49. ***
  50. _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 28, 2017._