New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

commentizer

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commentizer

Add jsdoc style comments to functions and class methods

  • 1.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Commentizer

Travis Codecov npm version code style: commentizer semantic-release greenkeeper>

Commentizer logo

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.

Keywords

FAQs

Package last updated on 11 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc