blob: e4c2b8b1a3a478569cc49f84bdfb9115f0cd7fd6 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001/*!
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
8'use strict';
9
10var path = require('path');
11var prefix = require('global-prefix');
12var isWindows = require('is-windows');
13var gm;
14
15function getPath() {
16 if (isWindows()) {
17 return path.resolve(prefix, 'node_modules');
18 }
19 return path.resolve(prefix, 'lib/node_modules');
20}
21
22/**
23 * Expose `global-modules` path
24 */
25
26Object.defineProperty(module, 'exports', {
27 enumerable: true,
28 get: function() {
29 return gm || (gm = getPath());
30 }
31});