Callback-style version of real-executable-path:
Find the first instance of an executable in the PATH, with expanding all symbolic links
const realExecutablePathCallback = require('real-executable-path-callback');
const which = require('which');
realExecutablePathCallback('npm', (err, binPath) => {
binPath; //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
});
npm install real-executable-path-callback
const realExecutablePathCallback = require('real-executable-path-callback');
binName: string
(an executable name in the PATH)
options: Object
(node-which
options except for all
)
callback: Function
(called after the path is resolved)
It finds the first instance of the given executable in the PATH environment variable, expands all symbolic links and resolves the canonicalized absolute pathname.
const realExecutablePathCallback = require('real-executable-path-callback');
realExecutablePathCallback('this_cmd_is_not_installed', err => {
err.message; //=> 'not found: this_cmd_is_not_installed'
err.code; //=> 'ENOENT'
});
- real-executable-path โ
Promise
version
ISC License ยฉ 2017 - 2019 Shinnosuke Watanabe