code: function getPackageName(installPackage) {
    if (installPackage.indexOf('git+') === 0) {
      // Pull package name out of git urls e.g:
      // git+https://github.com/mycompany/availity-react-kit.git
      // git+ssh://github.com/mycompany/availity-angular-kit.git#v1.2.3
      return installPackage.match(/([^/]+)\.git(#.*)?$/)[1];
    }
  
    if (installPackage.match(/.+@/)) {
      // Do not match @scope/ when stripping off @version or @tag
      return installPackage.charAt(0) + installPackage.substr(1).split('@')[0];
    }
  
    if (installPackage.match(/^file:/)) {
      const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];
      const installPackageJson = require(path.join(installPackagePath, 'package.json'));
      return installPackageJson.name;
    }
  
    return installPackage;
  }
docs: Extract package name from tarball url or path.