code: public static String compressJs(String code) {
          InputStream inStream = new ByteArrayInputStream(code.getBytes());
          ByteArrayOutputStream outStream = new ByteArrayOutputStream();
          JSMin jsmin = new JSMin(inStream, outStream);
          try {
              jsmin.jsmin();
              return outStream.toString().trim();
          } catch (Exception e) {
              e.printStackTrace();
              return "";
          }
      }
docs: Compress a JS-string
  
  @param code the js-code you want to compress
  @return the compressed code