code: function listInstalledVer(name, dir) {
          var _child$spawnSync3 = _child_process2['default'].spawnSync(npmCommand, ['list', name, '--depth', '0', '--json'], { cwd: dir });
  
          var stdout = _child$spawnSync3.stdout;
          var error = _child$spawnSync3.error;
          var status = _child$spawnSync3.status;
  
          // the package is invalid or uninstalled
          if (error || 0 !== status) {
              return '';
          }
  
          return JSON.parse(stdout)['version'];
      }
docs: list specific package version via npm
  
  @param {String} [name] published package name
  @param {String} [dir] list directory
  @public