get-bin

Get the name of the executable.

Usage no npm install needed!

<script type="module">
  import getBin from 'https://cdn.skypack.dev/get-bin';
</script>

README

get-bin NPM version NPM downloads Build Status

Get the name of the executable.

Install

$ npm install --save get-bin

Usage

const getBin = require('get-bin')

getBin().then(bin => {
  console.log(bin)
  //=> ['cli-name']
})

// if no `bin` set in `package.json`
getBin().then()
//=> null

// for a specific path
getBin({cwd: '/path/to/somewhere'}).then()

// in sync mode
getBin.sync()

API

getBin([options])

options

cwd

Type: string
Default: Path.dirname(module.parent.filename)

The path a package.json relative to.

.sync

Sync mode.

License

MIT © EGOIST