Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saltyshiomix/resolve-as-bin

Resolve a local npm package as the absolute binary path
https://github.com/saltyshiomix/resolve-as-bin

binary nodejs npm typescript

Last synced: 2 months ago
JSON representation

Resolve a local npm package as the absolute binary path

Awesome Lists containing this project

README

        





Resolve a local npm package as the absolute binary path

## Install

```bash
$ npm install --save resolve-as-bin
```

## Usage

```js
import resolve from 'resolve-as-bin';

// npm installed package
console.log(resolve('rimraf')); // "/absolute/path/to/node_modules/.bin/rimraf(.cmd)"

// relative or absolute paths are supported
console.log(resolve('./some-binary')); // "/absolute/path/to/some-binary(.cmd)"
console.log(resolve('/absolute/path/another-binary')); // "/absolute/path/another-binary(.cmd)"
```