npm / node-which

Like which(1) unix command. Find the first instance of an executable in the PATH.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can you document how to use this?

soichih opened this issue · comments

No documentation / sample on the README..

I tried something like this but didn't work

var which = require('which');

console.log(which.whichSync("git"));

which.which("git", function(err, path) {
console.log(path);
});

Ah.. this worked.

var which = require('which');
which("git", function(err, path) {
console.dir(path);
});

If you want the synchronous version, it's which.sync.