getNpmLibDefDirFromNested = (path: string): string => {
  const npmDefsDir = '/npm/';
  return path.substring(0, path.indexOf(npmDefsDir) + npmDefsDir.length);
}
When in a nested directory of npm libdefs such as package/libdef dir
find and return the root npm dir