All files / lib bin.js

100% Statements 15/15
100% Branches 4/4
100% Functions 3/3
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 153x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x   3x  
const npm = require('./npm.js')
const output = require('./utils/output.js')
const usageUtil = require('./utils/usage.js')
const completion = require('./utils/completion/none.js')
const PATH = require('./utils/path.js')
const cmd = (args, cb) => bin(args).then(() => cb()).catch(cb)
const usage = usageUtil('bin', 'npm bin [-g]')
const bin = async (args, cb) => {
  const b = npm.bin
  output(b)
  if (npm.flatOptions.global && !PATH.includes(b))
    console.error('(not in PATH env variable)')
}
module.exports = Object.assign(cmd, { usage, completion })