项目作者: shinnn

项目描述 :
Find the first instance of an executable in the PATH, with expanding all symbolic links
高级语言: JavaScript
项目地址: git://github.com/shinnn/real-executable-path.git
创建时间: 2015-11-07T10:21:09Z
项目社区:https://github.com/shinnn/real-executable-path

开源协议:ISC License

下载


real-executable-path

npm version
Build Status
Coverage Status

A Node.js module to find the first instance of an executable in the PATH, with expanding all symbolic links

  1. const realExecutablePath = require('real-executable-path');
  2. (async () => {
  3. await realExecutablePath('npm'); //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
  4. })();

Installation

Use npm.

  1. npm install real-executable-path

API

  1. const realExecutablePath = require('real-executable-path');

realExecutablePath(binName [, options])

binName: string (an executable name in the PATH)
options: Object (node-which options except for all)
Return: Promise<string>

It finds the first instance of the given executable in the PATH environment variable, expands all symbolic links and resolves the canonicalized absolute pathname.

License

ISC License © 2017 - 2019 Shinnosuke Watanabe