I need to document several functions defined in a single JS file. Each
has the following pattern:
// functions.js
/**
* A function
*/
var a = exports.someFunction = function() {
return "foo";
};
/**
* Another function
*/
var b = exports.someOtherFunction = function(){
return "bar";
};
These are coded as modules, but they will be consumed as global
functions, not as required modules. I looked at the JSDoc3 modules
pattern page for inspiration
(http://usejsdoc.org/howto-commonjs-modules.html). The patterns there
generated prototypes in the output, which I don't want in this case.
Rather, I want to list each function under the global namespace.
This seems pretty basic so I'm probably missing something obvious.
Thanks for any help.
Tim
// functions.js
/**
* @function someFunction
* @returns {string} foo
*/
var a = exports.someFunction = function() {
return "foo";
};
/**
* @function someOtherFunction
* @returns {string} bar
*/
var b = exports.someOtherFunction = function(){
return "bar";
};
Note that in JSDoc 3 you can either use a separate @name tag or put the @name after a tag that identifiers the @kind of thing you are documenting, so @function foo, @class foo, @method foo.qaz, @member foo.blat etc.
Michael Mathews
mic...@gmail.com
> --
> You received this message because you are subscribed to the Google Groups "JSDoc Users" group.
> To post to this group, send email to jsdoc...@googlegroups.com.
> To unsubscribe from this group, send email to jsdoc-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jsdoc-users?hl=en.
>