Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

whereis

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whereis - npm Package Compare versions

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;

5

package.json
{
"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

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