CMD batch processing, webstrom/phpstrom/..... IDE Tools compilation

Source: Internet
Author: User

Tools:an IED tool with auto-compilationCreate a file, the file name is arbitrary, can be modifiedTest.cmd
65001%~dp0test_cmd.js>/f/s//f/s/q test_cmd.min.js
View Code

Test_cmd.jsInstall node on premise.
varFS = require ("FS");varFileType = "html";//compiled file type (file suffix) before compilingvarFiletypeto = "html";//compiled file type (file suffix) after compilation//File WritefunctionXieru (fileName) {if(!fileName) {        return false; }    //to create a readable stream    varReaderstream = Fs.createreadstream (filename+ '. ') +FileType); varWriterstream = Fs.createwritestream (filename+ '. Min. ' +Filetypeto);//set the encoding to UTF8. Readerstream.setencoding (' UTF8 ');//Process Stream Events--data, end, and errorReaderstream.on (' Data ',function(chunk) {vardata =Chunk; Data= Data.replace (/^aa/img, "Zhang Yunshan"); Writerstream.write (data,' UTF8 ');        Writerstream.end (); //Process Stream Events--data, end, and errorWriterstream.on (' Finish ',function() {Console.log ("Write complete. ");        }); Writerstream.on (' Error ',function(Err) {console.log (err.stack);    });    }); Readerstream.on (' End ',function() {Console.log ("Read Complete");    }); Readerstream.on (' Error ',function(Err) {console.log (err.stack);    }); Console.log ("Program execution Complete");}///Get the file of the current directoryFs.readdir ("./",function(err, files) {if(err) {returnConsole.error (ERR); } Files.foreach (function(file) {if(File.indexof ("." +filetype)! =-1 && file.indexof ("Min.") +filetype) = =-1){            varFileName = File.replace (NewREGEXP ("\.") +filetype+ "$", "IMG"), "");        Xieru (FileName); }    });});
View Code

Use:

Customizable to compile your own language, or frame

cmd batch, webstrom/phpstrom/..... IDE Tools compile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.