Socket
Socket
Sign inDemoInstall

global-prefix

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-prefix - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

README.md

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)"
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc