Skip to content

Improve CommonJS module.exports example with clarification on where to document function Parameters #131

@KraigWalker

Description

@KraigWalker

The example in howto-commonjs-modules.md successfully explains how to document a function assigned to module.exports, but leaves doubt over where to correctly document the function's parameters (in this case color1 and color2)

I was wondering if I could add a little more to this example demonstrating where the parameters can be documented (should it be in the first DocBlock or along with the function description?)

 /**
 * Color mixer.
 * @module color/mixer
 */

/** Blend two colors together. */
module.exports = function(color1, color2) {
    // ...
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions