VSCode JSDoc automatic text to block comment conversion tool      

A helper tool for quickly resolving JSDoc text line breaks using the @example tag, for JavaScript/TypeScript
Input text to automatically generate comments (Text)
⇊⇊⇊
⇈⇈⇈
Input comments to automatically restore text (Comment)

VSCode / Cursor JSDoc: Enhancing JavaScript Documentation


JSDoc - Wikipedia
JSDoc is a powerful documentation generator for JavaScript. It uses specially formatted comments to create detailed API documentation for your code. By adding JSDoc comments to your JavaScript files, you can provide clear and structured information about your functions, classes, and modules.

Key features of JSDoc:

Type information
Function parameters and return values
Class and method descriptions
Module documentation
One particularly useful tag in JSDoc is the @example tag. This tag allows you to include code examples in your documentation. What sets our tool apart is its ability to preserve formatting, indentation, and line breaks within the @example tag. This means you can write more readable and realistic code examples, making it easier for developers to understand how to use your functions or classes.

Example usage:
/**
 * Calculates the sum of two numbers.
 * @param {number} a - The first number.
 * @param {number} b - The second number.
 * @returns {number} The sum of a and b.
 * @example
 * // This example preserves formatting and line breaks
 * const result = add(5, 3);
 * console.log(result);
 * // Output: 8
 */
function add(a, b) {
    return a + b;
}
By using our online JSDoc comment generator, you can easily create well-formatted documentation that includes preserved formatting in your code examples, making your JavaScript documentation more clear and effective.