code: function pathToPackage() {
          var upToNodeModules = segments
              .slice(0, -1)
              .concat('/')
              .join('node_modules');
  
          var packageName = segments[segments.length - 1]
              .split('/', 2)[1]
              + '/';
  
          return upToNodeModules + packageName;
      }
docs: it works, somehow ¯\_(ツ)_/¯