JSDoc

JSDoc
발표일1999년(25년 전)(1999)
최신 버전
3.6.3
(2019년 7월 15일(4년 전)(2019-07-15))
포맷 종류프로그래밍 문서화 포맷
다음에 포함자바스크립트 소스 파일
다음으로부터 확장JavaDoc
웹사이트jsdoc.app

JSDoc자바스크립트 소스 코드 파일들에 주해를 달기 위해 사용하는 마크업 언어이다. JSDoc을 포함하는 주석을 사용하는 프로그래머들은 자신들이 작성하는 코드의 API를 설명하는 설명 문서를 추가할 수 있다. 그 뒤 다양한 도구들에 의해 처리되어 HTML과 리치 텍스트 포맷 등의 접근 가능한 포맷으로 문서가 생성된다. JSDoc 사양은 CC BY-SA-3.0으로 배포되며, 이와 동반되는 문서 생성기와 파서 라이브러리는 아파치 라이선스 2.0으로 배포되는 자유 소프트웨어이다.

예시

/** @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)
}

같이 보기

외부 링크

  • Official JSDoc Website, for tutorials and docs on usage
  • Official JSDoc Github, for up-to-date code
  • "Annotating JavaScript for the Closure Compiler", Closure Tools documentation, Google Developer website
  • v
  • t
  • e
코드 분석
  • ESLint
  • JSHint
  • JSLint
컴파일러
개념
디버거
  • 파이어버그
  • 코모도 IDE
  • 마이크로소프트 스크립트 디버거
  • 마이크로소프트 스크립트 편집기
  • 오페라 드래곤플라이
  • Venkman
  • 사파리
도큐먼테이션 제네레이터
  • JSDoc
편집기 (비교)엔진
프레임워크관련 기술패키지 관리자
서버 사이드유닛 테스트
  • 재스민
  • Mocha
  • QUnit
  • 자바스크립트 유닛 테스트 프레임워크 목록
인물
  • v
  • t
  • e
방언
엔진
(비교)
프레임워크
클라이언트 사이드
서버 사이드
다중
  • 카푸치노
    • Objective-J
  • PureMVC
테스트
모듈관리 및 트랜스파일링
라이브러리
인물
기타
목록 문서 목록
자바스크립트 라이브러리
Ajax 프레임워크
비교
자바스크립트 프레임워크
서버 사이드 자바스크립트