1.0.17 • Published 6 years ago

commentizer v1.0.17

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Commentizer

Intro

Commentizer generates jsdoc style comments for javascript functions and class methods.

Install

npm install --save-dev commentizer

--- or globally

npm install -g commentizer

CLI

commentizer [filename ...]

Using glob to find files.

commentizer "src/**/*.js"

Only one file will have comments generated.

commentizer "src/my-file.js"

Examples

function declaration

Source File

function add(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};

Generated file

/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
function add(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};

function expression

Source File

const add = function(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};

Generated file

/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
const add = function(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};

arrow function expression

Source File

const add = (num1, num2) => {
  return num1 + num2;
}

module.exports = {
  add: add
};

Generated file

/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
const add = (num1, num2) => {
  return num1 + num2;
}

module.exports = {
  add: add
};

class method (ES2015)

Source File

export class TestClass {
  add(num1, num2) {
    return num1 + num2;
  }
};

Generated file

export class TestClass {
  /**
   * add
   * @param {} num1
   * @param {} num2
   * @returns {}
   */
  add(num1, num2) {
    return num1 + num2;
  }
};

Licensing

The code in this project is licensed under MIT license.

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago