npm-cli-path
Advanced tools
Comparing version 2.0.0 to 2.0.1
15
index.js
@@ -16,8 +16,11 @@ /*! | ||
} else { | ||
const path = require('path'); | ||
const pathLib = require('path'); | ||
const dirname = pathLib.dirname; | ||
const join = pathLib.join; | ||
const winUserInstalledNpmCliPath = require('win-user-installed-npm-cli-path'); | ||
const getPreinstalledNpmCliPath = getNpmCliPath.then(cmdPath => { | ||
return Promise.resolve(path.join(path.dirname(cmdPath), 'node_modules\\npm\\bin\\npm-cli.js')); | ||
return join(dirname(cmdPath), 'node_modules\\npm\\bin\\npm-cli.js'); | ||
}); | ||
@@ -28,3 +31,3 @@ | ||
if (/lstat .*\\node_modules\\npm\\bin\\npm-cli\.js/.test(err.message)) { | ||
return Promise.resolve(null); | ||
return null; | ||
} | ||
@@ -42,9 +45,5 @@ | ||
if (userInstalledCliPath) { | ||
return Promise.resolve(userInstalledCliPath); | ||
} | ||
return Promise.resolve(results[0]); | ||
return userInstalledCliPath || results[0]; | ||
}); | ||
}; | ||
} |
{ | ||
"name": "npm-cli-path", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Resolve the path of `npm-cli.js` included in the globally installed npm CLI", | ||
@@ -8,3 +8,3 @@ "repository": "shinnn/npm-cli-path", | ||
"scripts": { | ||
"pretest": "eslint --fix --config @shinnn/node index.js tests", | ||
"pretest": "eslint --fix --format=codeframe index.js tests", | ||
"test": "istanbul cover --dir=coverage/0 tests/no-npm.js && istanbul cover --dir=coverage/1 tests/posix.js", | ||
@@ -37,15 +37,18 @@ "coveralls": "istanbul report lcov && istanbul-coveralls" | ||
"dependencies": { | ||
"real-executable-path": "^2.0.0", | ||
"win-user-installed-npm-cli-path": "^2.0.0" | ||
"real-executable-path": "^2.0.1", | ||
"win-user-installed-npm-cli-path": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@shinnn/eslint-config-node": "^2.0.0", | ||
"eslint": "^2.13.0", | ||
"graceful-fs": "^4.1.4", | ||
"istanbul": "^0.4.3", | ||
"@shinnn/eslint-config-node": "^4.0.2", | ||
"eslint": "^4.11.0", | ||
"graceful-fs": "^4.1.11", | ||
"istanbul": "^0.4.5", | ||
"istanbul-coveralls": "^1.0.3", | ||
"pify": "^2.3.0", | ||
"pretend-platform": "^1.0.1", | ||
"tape": "^4.5.1" | ||
"pify": "^3.0.0", | ||
"pretend-platform": "^2.0.0", | ||
"tape": "^4.8.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": "@shinnn/node" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
4997
4
1
45
36