aboutsummaryrefslogtreecommitdiff
path: root/node_modules/global-prefix
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-20 03:09:25 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-24 16:14:29 +0200
commit82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8 (patch)
tree965f6eb89b84d65a62b49008fd972c004832ccd1 /node_modules/global-prefix
parente6e0cbc387c2a77b48e4065c229daa65bf1aa0fa (diff)
downloadwallet-core-82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8.tar.xz
Reorganize module loading.
We now use webpack instead of SystemJS, effectively bundling modules into one file (plus commons chunks) for every entry point. This results in a much smaller extension size (almost half). Furthermore we use yarn/npm even for extension run-time dependencies. This relieves us from manually vendoring and building dependencies. It's also easier to understand for new developers familiar with node.
Diffstat (limited to 'node_modules/global-prefix')
-rw-r--r--node_modules/global-prefix/index.js16
-rw-r--r--node_modules/global-prefix/package.json21
2 files changed, 25 insertions, 12 deletions
diff --git a/node_modules/global-prefix/index.js b/node_modules/global-prefix/index.js
index 591f6be8b..fa19422ff 100644
--- a/node_modules/global-prefix/index.js
+++ b/node_modules/global-prefix/index.js
@@ -7,10 +7,10 @@
'use strict';
-var fs = require('fs')
+var homedir = require('homedir-polyfill');
var path = require('path');
-var osenv = require('osenv');
var ini = require('ini');
+var fs = require('fs')
var prefix;
@@ -18,8 +18,12 @@ if (process.env.PREFIX) {
prefix = process.env.PREFIX;
} else {
// Start by checking if the global prefix is set by the user
- var userConfig = path.resolve(osenv.home(), '.npmrc');
- prefix = readPrefix(userConfig);
+ var home = homedir();
+ if (home) {
+ // homedir() returns undefined if $HOME not set; path.resolve requires strings
+ var userConfig = path.resolve(home, '.npmrc');
+ prefix = readPrefix(userConfig);
+ }
if (!prefix) {
// Otherwise find the path of npm
@@ -60,10 +64,10 @@ function fallback() {
function npmPath() {
try {
- return fs.realpathSync(require('which').sync('npm'))
+ return fs.realpathSync(require('which').sync('npm'));
} catch (ex) {
}
- return false
+ return false;
}
function readPrefix(configPath) {
diff --git a/node_modules/global-prefix/package.json b/node_modules/global-prefix/package.json
index 28f595305..4dc678600 100644
--- a/node_modules/global-prefix/package.json
+++ b/node_modules/global-prefix/package.json
@@ -1,7 +1,7 @@
{
"name": "global-prefix",
"description": "Get the npm global path prefix.",
- "version": "0.1.4",
+ "version": "0.1.5",
"homepage": "https://github.com/jonschlinkert/global-prefix",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"repository": "jonschlinkert/global-prefix",
@@ -20,14 +20,15 @@
"test": "mocha"
},
"dependencies": {
+ "homedir-polyfill": "^1.0.0",
"ini": "^1.3.4",
"is-windows": "^0.2.0",
- "osenv": "^0.1.3",
- "which": "^1.2.10"
+ "which": "^1.2.12"
},
"devDependencies": {
- "gulp-format-md": "^0.1.9",
- "mocha": "^2.5.3"
+ "fs-exists-sync": "^0.1.0",
+ "gulp-format-md": "^0.1.11",
+ "mocha": "^3.2.0"
},
"keywords": [
"global",
@@ -60,5 +61,13 @@
"lint": {
"reflinks": true
}
- }
+ },
+ "contributors": [
+ "Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)",
+ "Alexandr Bogachev <kuksikus@gmail.com> (https://github.com/rmbaad)",
+ "JasonChang <chaoyue.chang@qq.com> (https://packagist.org/packages/jason-chang)",
+ "Jorrit Schippers (https://www.ncode.nl)",
+ "Mathias Rasmussen (https://github.com/mathiasvr)",
+ "Charlike Mike Reagent (http://i.am.charlike.online)"
+ ]
}