kentcdodds / nps-utils

Utilities for http://npm.im/nps (npm-package-scripts)
https://doclets.io/kentcdodds/nps-utils/master
MIT License
101 stars 23 forks source link

export getBin, but without prepending node #29

Closed wmertens closed 6 years ago

wmertens commented 6 years ago

It would be nice to be able to get the path to a binfile of a package. getBin is not exported, but it also prepends node.

So I propose adding const runBin = (...args) => `node ${getBin(...args)}` internally and exporting getBin

My very specific use case would be to be able to run Jest under ndb like

const {getBin} = require('nps-utils')

module.exports = {
 test: {
   inspect: `ndb ${getBin('jest')} --runInBand`
 }
}
kentcdodds commented 6 years ago

PRs welcome 👍