Use jsdoc

Asked
Active3 hr before
Viewed126 times

4 Answers

jsdoc
90%

JSDoc is an open source API documentation generator for Javascript, It allows developers to document their code through comments

Example_snippet/controller/utility/_jsdoc.js/ /** * Retrieves a single fil. . .
/**
 *  Retrieves a single file by id.
 *  @param {string} id File identifier.
 *  @returns {File} File object.
 */
const getFileById = (id) => {
   // ...
}
load more v
88%

JSDoc supports stable versions of Node,js 8

Example_snippet/controller/utility/_jsdoc.js/ npm install -g jsdoc . . .
npm install - g jsdoc
load more v
72%

An API documentation generator for JavaScript,,Documentation is available at jsdoc

Example_snippet/controller/utility/_model.js/ npm install -g jsdoc . . .
npm install - g jsdoc
load more v
65%

Example_snippet/controller/utility/_model.js/ /** @class Circle representing. . .
/** @class Circle representing a circle. */
class Circle {
   /**
    * Creates an instance of Circle.
    *
    * @author: moi
    * @param {number} r The desired radius of the circle.
    */
   constructor(r) {
      /** @private */
      this.radius = r
      /** @private */
      this.circumference = 2 * Math.PI * r
   }

   /**
    * Creates a new Circle from a diameter.
    *
    * @param {number} d The desired diameter of the circle.
    * @return {Circle} The new Circle object.
    */
   static fromDiameter(d) {
      return new Circle(d / 2)
   }

   /**
    * Calculates the circumference of the Circle.
    *
    * @deprecated since 1.1.0; use getCircumference instead
    * @return {number} The circumference of the circle.
    */
   calculateCircumference() {
      return 2 * Math.PI * this.radius
   }

   /**
    * Returns the pre-computed circumference of the Circle.
    *
    * @return {number} The circumference of the circle.
    * @since 1.1.0
    */
   getCircumference() {
      return this.circumference
   }

   /**
    * Find a String representation of the Circle.
    *
    * @override
    * @return {string} Human-readable representation of this Circle.
    */
   toString() {
      return `[A Circle object with radius of ${this.radius}.]`
   }
}

/**
 * Prints a circle.
 *
 * @param {Circle} circle
 */
function printCircle(circle) {
   /** @this {Circle} */
   function bound() {
      console.log(this)
   }
   bound.apply(circle)
}