0.0.2 • Published 9 years ago

no-comment v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

no-comment

Remove C and C++ style comments and any surrounding whitespace.

/*
    C style multi-line block comment
*/

// C++ style single-line comment

Note that the regular expressions used here are fairly naive and sacrifice some correctness to reduce incorrect matches.

Usage

JavaScript

var noComment = require('no-comment');
var fs = require('fs');
var output = noComment(fs.readFileSync('foo.txt').toString());
console.log(output);

Shell

no-comment source_file [target_file]

Note that output goes to stdout if target_file is omitted.