Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/saltyshiomix/resolve-as-bin
- Owner: saltyshiomix
- License: mit
- Created: 2018-07-26T13:19:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T14:09:24.000Z (over 1 year ago)
- Last Synced: 2024-05-01T15:14:25.517Z (8 months ago)
- Topics: binary, nodejs, npm, typescript
- Language: TypeScript
- Homepage: https://npm.im/resolve-as-bin
- Size: 14.6 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)"
```