The compression library is the closure compiler provided by Google.
Https://developers.google.com/closure/compiler? Hl = ZH-CN
Using system; using system. collections. generic; using system. LINQ; using system. text; using system. diagnostics; namespace testprocessdoscmd {class program {static void main (string [] ARGs) {PROCESS p = NULL; P = new process (); p. startinfo. filename = "cmd.exe"; p. startinfo. useshellexecute = false; p. startinfo. redirectstandardinput = true; p. startinfo. redirectstandardoutput = false; p. startinfo. redirects Tandarderror = false; p. startinfo. createnowindow = false; p. start (); string sresult = string. empty; string strcmd = "Java-jar compiler. jar -- Help "; // string strcmd = @" Java-jar compiler. jar -- js d: \ devsoft \ library \ compiler-Latest \ js_name.js -- js_output_file D: \ devsoft \ library \ compiler-Latest \ js_name_compressed_prog.js "; // The source file cannot be placed in the same location as the target file. // string strcmd = @ "Java-jar compiler. jar -- js d: \ devsoft \ Library \ compiler-Latest \ js_name_bak.js -- js_output_file D: \ devsoft \ library \ compiler-Latest \ js_name_bak.js "; // string strcmd =" Java-version "; p. standardinput. writeline (strcmd); // while (! P. standarderror. endofstream) // {// sresult = P. standarderror. readline (); // console. writeline (sresult); //} // P. standardinput. flush (); // while (! P. standardoutput. endofstream) // {// sresult = P. standardoutput. readline (); // console. writeline (sresult); //} p. standardinput. writeline ("exit"); p. waitforexit (); p. close (); console. writeline ("press any key to exit. "); console. readkey ();}}}
From: https://developers.google.com/closure/compiler/docs/api-tutorial1? Hl = ZH-CN
#! /Usr/bin/python2.4import httplib, urllib, sys # define the parameters for the POST request and encode them in # a URL-safe format. params = urllib. urlencode ([('js _ Code', sys. argv [1]), ('compilation _ level', 'whitespace _ only'), ('output _ format', 'text'), ('output _ info ', 'compiled _ Code'),]) # Always use the following value for the Content-Type header. headers = {"Content-Type": "application/X-WWW-form-urlencoded"} conn = httplib. httpconnection ('Closure -compiler.appspot.com ') Conn. request ('post', '/compile', Params, headers) response = Conn. getresponse () Data = response. read () print dataconn. close