Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid Global Scope documentation generated by JSDoc on NodeJS functions?

JSdoc generated documentation on my nodejs modules.

/**
 Do something
*/
function doSomething(param1, param2) {
  // blah blah
  ...
}

module.exports.doSomething = doSomething;

JSDoc's generated file generated the comment under Global scope, and I have hundreds of exported functions like that.

Is there any way to make JSDoc to generated the documentations grouped by module file names?

like image 830
user2901800 Avatar asked Sep 27 '22 07:09

user2901800


1 Answers

At the top of your file, you need to include a jsdoc comment like so. You can also name the module to something else if desired.

/**
 @module FileNameOrCustomModuleName
*/

I don't think you can have multiple @module directives in a single file though.

like image 106
myclues Avatar answered Oct 12 '22 23:10

myclues