saltyshiomix / resolve-as-bin

Resolve a local npm package as the absolute binary path

Home Page:https://npm.im/resolve-as-bin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolve a local npm package as the absolute binary path

Install

$ npm install --save resolve-as-bin

Usage

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)"

About

Resolve a local npm package as the absolute binary path

https://npm.im/resolve-as-bin

License:MIT License


Languages

Language:TypeScript 100.0%