Skip to content

JonathanStoye/single-line-to-multi-line-comment-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint version npm version license

single-line-to-multi-line-comment-converter

Replaces single line comments in js with block comments if appropriate. Takes .gitignore into account and ignores hidden files on default as well.

E.g.:

  //
  // Request smth
  //
  // @param {mixed} array of smth
  // @return {promise}
  //
  
  // single line comment
  
  // ##################################
  //
  // Private methods
  //
  // #################################

will turn into

  /**
   * Request smth
   *
   * @param {mixed} array of smth
   * @return {promise}
   */
   
   // single line comment
   
   /**
   * ##################################
   *
   * Private methods
   *
   * #################################
   */

Installation

npm install -g single-line-to-multi-line-comment-converter

Usage

sl2ml testFile.js

or

sl2ml testfolder/

Use -o outputfile to specify an outputfile instead of replacing the comments in the input file. (ignored on folders)

sl2ml testFile.js -o testFile.parsed.js

or use -p prefix to specify a prefix attach to the processed file(s).

sl2ml testFile.js -p parsed

will result in

testFile.js (unchanged)
testFile.parsed.js (parsed file)

Use -h --help to display this options.

About

Replaces single line comments in js with block comments if appropriate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published