Add local node_modules binaries to PATH for script execution.
Get your PATH prepended with locally installed binaries. This is a fork of sindresorhus/npm-run-path, but with CommonJS support.
$ npx @esm2cjs/npm-run-path --help$ node -e "const npmRunPath = require('@esm2cjs/npm-run-path'); console.log(npmRunPath())"$ node -e "const {execSync} = require('child_process'); const npmRunPath = require('@esm2cjs/npm-run-path'); execSync('eslint .', {env: {...process.env, PATH: npmRunPath()}})"$ export PATH="$(node -e \"console.log(require('@esm2cjs/npm-run-path')())\")":$PATH$ which $(node -e "const p = require('@esm2cjs/npm-run-path'); console.log('webpack')") || echo 'not found'