6

How can namespaces be documented in JavaScript with jsDoc?

Here is my attempt, is this right?

/**
 * My special namespace
 *
 * @name my.namespace
 * @namespace
 */
$namespace('my.namespace', /** @lends my.namespace **/ {
    /**
     * Foo - does something really neat...
     * @function
     */
    foo: function() {
    }
});

Just to clarify, the above is used as follows:

my.namespace.foo();
1
  • I know this is really old, but i am curious. Is $namespace something custom of yours? Commented Jan 5, 2015 at 10:17

1 Answer 1

8

This feature is available in jsdoc3 micmath/jsdoc. The syntax of jsdoc3 is different to jsdoc-toolkit (jsdoc2)

The following example was by Michael jsdoc and pseudo-namespaces?

/**
* Document me.
* @namespace my
*/

/**
* My special namespace
* @namespace my.namespace
*/
$namespace('my.namespace', /** @lends my.namespace **/ {
   /**
    * Foo - does something really neat...
    */
   foo: function() {
   }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.