node/deps/npm/lib/commands/bin.js
npm team 8a03482cf1
deps: upgrade npm to 8.1.4
PR-URL: https://github.com/nodejs/node/pull/40865
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-11-22 09:37:01 +01:00

18 lines
447 B
JavaScript

const envPath = require('../utils/path.js')
const BaseCommand = require('../base-command.js')
class Bin extends BaseCommand {
static description = 'Display npm bin folder'
static name = 'bin'
static params = ['global']
async exec (args) {
const b = this.npm.bin
this.npm.output(b)
if (this.npm.config.get('global') && !envPath.includes(b)) {
console.error('(not in PATH env variable)')
}
}
}
module.exports = Bin