code: function getInitCwd () {
    if (process.env.INIT_CWD) {
      debug(`process.env.INIT_CWD: ${process.env.INIT_CWD}`)
      return process.env.INIT_CWD
    }
  
    const cwd = process.cwd()
  
    debug(`process.cwd(): ${cwd}`)
  
    // 兼容 npm v3
    return cwd.split(`${path.sep}node_modules${path.sep}`)[0]
  }
docs: 获取通过 npm script 执行时的项目根路径
  
  @returns {string} cwd
   /* istanbul ignore next