typedoc-comments
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

typedoc-comments

Thin plugin adds comments from your function to its doc

example.ts:

/**
 * Finds min
 */
function min(elements: number[]): number {
  /*
    First of all, set result to maximum available number
    to replace it with actual value on first iteration
  */
  let res = Infinity

  // Iterate over provided elements
  for (const el of elements) {
    if (el < res) {
      // Store value as result
      res = el
    }
  }

  // Return result
  return res
}

Run using

typedoc --plugin typedoc-comments example.ts

Will provide documentation like

1. First of all, set result to maximum available number
  to replace it with actual value on first iteration

2. Iterate over provided elements

    1. if el < res

        1.Store value as result

3. Return result

Package Sidebar

Install

npm i typedoc-comments

Weekly Downloads

4

Version

1.0.1

License

ISC

Unpacked Size

46.3 kB

Total Files

44

Last publish

Collaborators

  • aliksend