docs: function getPackageName(installPackage) {
    if (installPackage.match(/^.+\.(tgz|tar\.gz)$/)) {
      return getTemporaryDirectory()
        .then(obj => {
          let stream;
          if (/^http/.test(installPackage)) {
            stream = hyperquest(installPackage);
          } else {
            stream = fs.createReadStream(installPackage);
          }
          return extractStream(stream, obj.tmpdir).then(() => obj);
        })
        .then(obj => {
          const packageName = require(path.join(obj.tmpdir, 'package.json')).name;
          obj.cleanup();
          return packageName;
        })
        .catch(err => {
          // The package name could be with or without semver version, e.g. tscomp-0.2.0-alpha.1.tgz
          // However, this function returns package name only without semver version.
          console.log(
            `Could not extract the package name from the archive: ${err.message}`
          );
          const assumedProjectName = installPackage.match(
            /^.+\/(.+?)(?:-\d+.+)?\.(tgz|tar\.gz)$/
          )[1];
          console.log(
            `Based on the filename, assuming it is "${chalk.cyan(
              assumedProjectName
            )}"`
          );
          return Promise.resolve(assumedProjectName);
        });
    } else if (installPackage.indexOf('git+') === 0) {
      // Pull package name out of git urls e.g:
      // git+https://github.com/mycompany/tscomp.git
      // git+ssh://github.com/mycompany/tscomp.git#v1.2.3
      return Promise.resolve(installPackage.match(/([^/]+)\.git(#.*)?$/)[1]);
    } else if (installPackage.match(/.+@/)) {
      // Do not match @scope/ when stripping off @version or @tag
      return Promise.resolve(
        installPackage.charAt(0) + installPackage.substr(1).split('@')[0]
      );
    } else if (installPackage.match(/^file:/)) {
      const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];
      const installPackageJson = require(path.join(
        installPackagePath,
        'package.json'
      ));
      return Promise.resolve(installPackageJson.name);
    }
    return Promise.resolve(installPackage);
  }