Created
December 26, 2014 16:03
-
-
Save jixunmoe/d1c21b16ca14cb39fd69 to your computer and use it in GitHub Desktop.
移除 // 开头的注释
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (str) { | |
// 过滤注释 | |
console.info (str.split('\n') | |
.filter(function (s) { return ! /^\s*\/\//.test(s); }) | |
.join('\n')); | |
// 空行也会保留 | |
})(require('fs').readFileSync(__filename).toString()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment