Skip to content

Lochlan/no-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.

Releases

No releases published

Packages

No packages published