Skip to main content

@namespace

Syntax

@namespace
@namespace name

Overview

@namespace marks a symbol as a namespace — an object used to group related items. Symbols defined within a namespace are accessible via dotted namepaths like MyApp.utils.format.

Examples

Object literal namespace

/**
* Utility functions for formatting.
* @namespace
*/
const utils = {
/**
* Format a date as ISO 8601.
* @param {Date} date
* @returns {string}
*/
formatDate(date) {
return date.toISOString();
},
};

Explicit namespace name

/**
* @namespace MyApp.models
*/

Virtual namespace

If the namespace is never explicitly assigned to a variable, you can document it as a virtual symbol:

/**
* @namespace MyApp
*/

/**
* @namespace MyApp.utils
*/

See also

Official reference: jsdoc.app/tags-namespace