Merge-comments
What is it?
Merge-comments is a tool that merges single-line comments into multi-line ones.
Example
file.js
// alone commentvar a = 'b';// first comment// second comment// third comment
$ merge-commits ./file.jsDone: file.js:// alone commentvar a = 'b';/** * first comment * second comment * third comment */
Usage
Install with npm:
$ [sudo] npm install merge-comments --save
If you want to use merge-comments
on your cli install with:
$ [sudo] npm install merge-comments -g
CLI
Usage:
$ merge-comments [OPTIONS]
Options:
-i INPUT, --input=INPUT : Glob string or file path to process, "-"
Arguments:
INPUT : Alias to --input
Example:
- with files:
$ merge-comments test.js or $ merge-comments test.js -o ./merged/ or $ merge-comments test.js test2.js -o ./merged/ or $ merge-comments *.js -o ./merged/ -m merged_?
- with STDIN / STDOUT:
$ cat test.js | merge-comments -i - -o - > test.merged.js