# commentizer

> Add jsdoc style comments to functions and class methods

Latest version **1.0.17** (published 2018-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install commentizer
pnpm add commentizer
yarn add commentizer
bun add commentizer
```

Provides the command `commentizer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.17 |
| Published | 2018-07-11 |
| First published | 2018-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 7 |
| Unpacked size | 27.7 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brian Schemp |
| Maintainers | schempy |
| Keywords | jsdoc, comments, generator, parse |

## Links

- npm: https://www.npmjs.com/package/commentizer
- Repository: https://github.com/schempy/commentizer
- Homepage: https://github.com/schempy/commentizer#readme
- Issues: https://github.com/schempy/commentizer/issues
- npm.io page: https://npm.io/package/commentizer

## Dependencies (7)

- [globby](https://npm.io/package/globby.md) 8.0.1
- [minimist](https://npm.io/package/minimist.md) 1.2.0
- [@babel/types](https://npm.io/package/@babel/types.md) 7.0.0-beta.52
- [@babel/parser](https://npm.io/package/@babel/parser.md) 7.0.0-beta.53
- [@babel/template](https://npm.io/package/@babel/template.md) 7.0.0-beta.52
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) 7.0.0-beta.52
- [@babel/generator](https://npm.io/package/@babel/generator.md) 7.0.0-beta.52

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.17 (latest) — 2018-07-11
- 1.0.16 — 2018-07-11
- 1.0.15 — 2018-07-11
- 1.0.14 — 2018-07-11
- 1.0.13 — 2018-06-01
- 1.0.12 — 2018-05-31
- 1.0.11 — 2018-05-31
- 1.0.10 — 2018-03-31
- 1.0.9 — 2018-03-15
- 1.0.8 — 2018-03-15
- 1.0.7 — 2018-03-15
- 1.0.6 — 2018-03-15
- 1.0.5 — 2018-03-15
- 1.0.4 — 2018-02-23
- 1.0.3 — 2018-02-22
- … 3 more at https://npm.io/package/commentizer/versions

## README

# Commentizer

<p align="center">
  <a href="https://travis-ci.org/schempy/commentizer">
    <img alt="Travis" src="https://img.shields.io/travis/schempy/commentizer/master.svg?style=flat-square">
  </a>
  <a href="https://codecov.io/gh/schempy/commentizer">
    <img alt="Codecov" src="https://img.shields.io/codecov/c/github/schempy/commentizer.svg?style=flat-square">
  </a>
  <a href="https://www.npmjs.com/package/commentizer">
    <img alt="npm version" src="https://img.shields.io/npm/v/commentizer.svg?style=flat-square">
  </a>
  <a href="#badge">
    <img alt="code style: commentizer" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square">
  </a>
  <a href="#badge">
    <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
  </a>
  <a>
    <img alt="greenkeeper>" src="https://badges.greenkeeper.io/schempy/commentizer.svg">
  </a> 
</p>

<p align="center">
	<img src="./.assets/logo.png" height="200" width="200" alt="Commentizer logo"/>
</p>

## Intro
Commentizer generates [jsdoc](https://github.com/jsdoc3/jsdoc) style comments for javascript functions and class methods.

## Install
```js
npm install --save-dev commentizer

--- or globally

npm install -g commentizer
```

## CLI
```js
commentizer [filename ...]
```

Using glob to find files.
```js
commentizer "src/**/*.js"
```

Only one file will have comments generated.
```js
commentizer "src/my-file.js"
```

## Examples
- [`function declaration`](#function_declaration)
- [`function expression`](#function_expression)
- [`arrow function expression`](#arrow_function_expression)
- [`class method (ES2015)`](#class_method)

### <a id="function_declaration"></a> function declaration
#### Source File
```js
function add(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

#### Generated file
```js
/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
function add(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

### <a id="function_expression"></a> function expression
#### Source File
```js
const add = function(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

#### Generated file
```js
/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
const add = function(num1, num2) {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

### <a id="arrow_function_expression"></a> arrow function expression
#### Source File
```js
const add = (num1, num2) => {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

#### Generated file
```js
/**
 * add
 * @param {} num1
 * @param {} num2
 * returns {}
 */
const add = (num1, num2) => {
  return num1 + num2;
}

module.exports = {
  add: add
};
```

### <a id="class_method"></a> class method (ES2015)
#### Source File
```js
export class TestClass {
  add(num1, num2) {
    return num1 + num2;
  }
};
```

#### Generated file
```js
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.

---
_Source: https://npm.io/package/commentizer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
