code: function packageNameFromPath(path) {
    var matches = moduleRegex.exec(path);
    return matches && matches.length > 1 ? matches[1] : null;
  }
docs: Retrieves a package name from the full import path.
  For example:
  './node_modules/bar/index/foo.js' => 'bar'
  
  @param {string} path The full import path.