Ei kuvausta

index.js 604B

12345678910111213141516171819202122232425262728293031
  1. /*!
  2. * global-modules <https://github.com/jonschlinkert/global-modules>
  3. *
  4. * Copyright (c) 2015-2017 Jon Schlinkert.
  5. * Licensed under the MIT license.
  6. */
  7. 'use strict';
  8. var path = require('path');
  9. var prefix = require('global-prefix');
  10. var isWindows = require('is-windows');
  11. var gm;
  12. function getPath() {
  13. if (isWindows()) {
  14. return path.resolve(prefix, 'node_modules');
  15. }
  16. return path.resolve(prefix, 'lib/node_modules');
  17. }
  18. /**
  19. * Expose `global-modules` path
  20. */
  21. Object.defineProperty(module, 'exports', {
  22. enumerable: true,
  23. get: function() {
  24. return gm || (gm = getPath());
  25. }
  26. });