code: function npm(pathToCode, args, callback) {
    // Don't key cwd on leading '/' as that breaks in Windows
    let cwd = pathToCode.startsWith(process.cwd())
      ? pathToCode
      : path.join(process.cwd(), pathToCode)
    let win = process.platform.startsWith('win')
    let cmd = win
      ? 'npm.cmd'
      : 'npm'
    let options = {cwd, shell:true}
    // Normalize and make relative pathToCode for error messages
    pathToCode = pathToCode.replace(process.cwd() + '/', '')
    let subprocess = spawn(cmd, args, options)
    let stderr = []
    subprocess.stderr.on('data', function data(chunk) {
      stderr.push(chunk)
    })
    subprocess.on('exit', function exit(code) {
      // Deal with NPM errors in userland
      let npmErr
      if (code !== 0) {
        npmErr = new Error(`npm ${args.join(' ')} in ${pathToCode} exited with code ${code}\n  ${Buffer.concat(stderr).toString().split('\n').join('\n  ')}`)
      }
      callback(null, npmErr)
    })
    // Deal with child process errors
    subprocess.on('error', function fail(err) {
      callback(err)
    })
  }
docs: NPM operations