Socket
Book a DemoInstallSign in
Socket

module-bin-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-bin-path

Get the absolute file path to a bin entry of an installed dependency

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1.5K
-3.09%
Maintainers
1
Weekly downloads
 
Created
Source

module-bin-path

Get the absolute file path to a bin entry of an installed dependency. Useful if you want to include a cli as an npm dependency and spawn it from node.

npm install module-bin-path

Usage

// let's assume npm install --save some-cli was include

const binPath = require('module-bin-path')
console.log('path to the bin entry', binPath('some-cli'))

// to spawn the included cli do

const child = childProcess.spawn(binPath('some-cli'), [ ... ])

API

const path = binPath(moduleName, [binEntry])

Get the absolute path to a modules package.json bin entry.

binEntry is the bin entry name. Defaults to moduleName.

License

MIT

FAQs

Package last updated on 04 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts