Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/real-executable-path
Find the first instance of an executable in the PATH, with expanding all symbolic links
https://github.com/shinnn/real-executable-path
async executable javascript nodejs promise symbolic-links symlink
Last synced: 27 days ago
JSON representation
Find the first instance of an executable in the PATH, with expanding all symbolic links
- Host: GitHub
- URL: https://github.com/shinnn/real-executable-path
- Owner: shinnn
- License: isc
- Created: 2015-11-07T10:21:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-13T12:03:23.000Z (almost 6 years ago)
- Last Synced: 2024-10-12T14:51:08.573Z (about 1 month ago)
- Topics: async, executable, javascript, nodejs, promise, symbolic-links, symlink
- Language: JavaScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# real-executable-path
[![npm version](https://img.shields.io/npm/v/real-executable-path.svg)](https://www.npmjs.com/package/real-executable-path)
[![Build Status](https://travis-ci.com/shinnn/real-executable-path.svg?branch=master)](https://travis-ci.com/shinnn/real-executable-path)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/real-executable-path.svg)](https://coveralls.io/github/shinnn/real-executable-path)A [Node.js](https://nodejs.org) module to find the first instance of an executable in the PATH, with expanding all symbolic links
```javascript
const realExecutablePath = require('real-executable-path');(async () => {
await realExecutablePath('npm'); //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
})();
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install real-executable-path
```## API
```javascript
const realExecutablePath = require('real-executable-path');
```### realExecutablePath(*binName* [, *options*])
*binName*: `string` (an executable name in the PATH)
*options*: `Object` ([`node-which` options](https://github.com/npm/node-which#options) except for `all`)
Return: `Promise`It finds the first instance of the given executable in the [PATH](http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html#tag_08_03) environment variable, expands all symbolic links and resolves the canonicalized absolute pathname.
## Related projects
* [real-executable-paths](https://github.com/shinnn/real-executable-paths) – Returns all matched paths, instead of just the first one
* [real-which](https://github.com/shinnn/real-which) – CLI## License
[ISC License](./LICENSE) © 2017 - 2019 Shinnosuke Watanabe