code: public static String getVersionFromNPM(File npmDirectory, Log log) {
          File packageFile = new File(npmDirectory, PACKAGE_JSON);
          if (!packageFile.isFile()) {
              return "0.0.0";
          }
  
          FileReader reader = null;
          try {
              reader = new FileReader(packageFile);  //NOSONAR
              JSONObject json = (JSONObject) JSONValue.parseWithException(reader);
              return (String) json.get("version");
          } catch (IOException | ParseException e) {
              log.error("Cannot extract version from " + packageFile.getAbsolutePath(), e);
          } finally {
              IOUtils.closeQuietly(reader);
          }
  
          return null;
      }
docs: Utility method to extract the version from a NPM by reading its 'package.json' file.
  
  @param npmDirectory the directory in which the NPM is installed
  @param log          the logger object
  @return the read version, "0.0.0" if there are not 'package.json' file, {@code null} if this file cannot be
  read or does not contain the "version" metadata