npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

module-bin-path

1.0.1

@mafintosh

npmHomeRepoSnykSocket
Downloads:320
$ npm install module-bin-path
DailyWeeklyMonthlyYearly

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