global-prefix
Advanced tools
Comparing version 0.1.4 to 0.1.5
16
index.js
@@ -10,6 +10,6 @@ /*! | ||
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') | ||
@@ -22,4 +22,8 @@ var prefix; | ||
// 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); | ||
} | ||
@@ -65,6 +69,6 @@ if (!prefix) { | ||
try { | ||
return fs.realpathSync(require('which').sync('npm')) | ||
return fs.realpathSync(require('which').sync('npm')); | ||
} catch (ex) { | ||
} | ||
return false | ||
return false; | ||
} | ||
@@ -71,0 +75,0 @@ |
{ | ||
"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", | ||
@@ -23,10 +23,11 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"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" | ||
}, | ||
@@ -64,3 +65,11 @@ "keywords": [ | ||
} | ||
} | ||
}, | ||
"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)" | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
7914
4
72
0
76
3
1
+ Addedhomedir-polyfill@^1.0.0
+ Addedhomedir-polyfill@1.0.3(transitive)
+ Addedparse-passwd@1.0.0(transitive)
- Removedosenv@^0.1.3
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
Updatedwhich@^1.2.12