Comparing version 0.4.1 to 1.0.0
32
index.js
@@ -1,31 +0,3 @@ | ||
var cp = require('child_process'); | ||
var which = require('which'); | ||
module.exports = function whereis(name, cb) { | ||
cp.execFile('which', [name], function(error, stdout, stderr) { | ||
stdout = stdout.split('\n')[0]; | ||
if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { | ||
stdout = stdout.split('\n')[0]; | ||
cp.execFile('whereis', [name], function(error, stdout, stderr) { | ||
if (error || stderr || stdout === '' || stdout.indexOf( '/' ) === -1) { | ||
cp.execFile('where', [name], function (error, stdout, stderr) { //windows | ||
if (error || stderr || stdout === '' || stdout.indexOf('\\') === -1) { | ||
cp.exec('for %i in (' + name + '.exe) do @echo. %~$PATH:i', function (error, stdout, stderr) { //windows xp | ||
if (error || stderr || stdout === '' || stdout.indexOf('\\') === -1) { | ||
return cb(new Error('Could not find ' + name + ' on your system')); | ||
} | ||
return cb(null, stdout); | ||
}); | ||
} else { | ||
return cb(null, stdout); | ||
} | ||
}); | ||
} | ||
else { | ||
return cb(null, stdout.split(' ')[1]); | ||
} | ||
}); | ||
} else { | ||
return cb(null, stdout); | ||
} | ||
}); | ||
}; | ||
module.exports = which; |
{ | ||
"name": "whereis", | ||
"version": "0.4.1", | ||
"version": "1.0.0", | ||
"author": "Vincent Voyer <vincent@zeroload.net>", | ||
@@ -21,3 +21,6 @@ "description": "Which/Whereis easy helper, find if a program exists", | ||
"test": "node test" | ||
}, | ||
"dependencies": { | ||
"which": "1.3.0" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
**Note from maintainers: Nowadays you should use https://github.com/npm/node-which** | ||
# node-whereis <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![Build Status][travis-svg]][travis-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] | ||
@@ -2,0 +4,0 @@ |
Sorry, the diff of this file is not supported yet
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
23
1
7842
1
6
2
+ Addedwhich@1.3.0
+ Addedisexe@2.0.0(transitive)
+ Addedwhich@1.3.0(transitive)