jsdoc code example

Example 1: install jsdoc

npm install -g jsdoc
# or
npm install --save-dev jsdoc

Example 2: use jsdoc

/**
 * @file filename
 * @author you <email>
 * @version 0.1
 */

  /**
   * Function definition.
   *
   * @param {String} arg1.
   * @param {Number} arg2
   * @param {Object} arg3
   */

    /**
     * Return.
     *
     * @see [Example]{@link http://example.com}
     * @returns {Number} The value of..
     */
jsdoc filename.js

Example 3: jsdocs returns

@return {type}

Example 4: jsdocs

// Example JSDoc

/**
   * Update file details.
   * PUT or PATCH files/:id
   *
   * @param {object} ctx
   * @param {Request} ctx.request
   * @param {Response} ctx.response
*/
async update({ params, request, response }) {}