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

Support modern async/Promise usage

GitSquared opened this issue · comments

It'd be great if which supported the new Promises-based async syntax together with the more traditional callback-based async it currently has.

Example:

const which = require('which');

(async function() {
  let path = await which('bash').catch(e => {
    throw e;
  });
  
  console.log(e);
})();

I would be willing to send a (backwards-compatible) PR for this but I won't be able to until this weekend - I'm opening this first in case anyone is also interested/has remarks on the issue.