Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
移除 // 开头的注释
(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
You can’t perform that action at this time.