Documentation for module (Feature Request)
See original GitHub issueIt will be great to add support of documentation for module. Ill explain the case: i have module with logicaly grouped helpers. I can use it with 2 ways. With first i need to create class with static helpers, and export it as default. Then i need to use it in this way:
import helpers from 'helpers';
helpers.method();
helpers.const;
With second way ill define all helpers as simple functions and export them all from my module.
let helper = function(){};
export {helper};
Then ill use it:
import * as helpers from 'helpers';
helpers.method();
helpers.const;
But with this way i can import only helpers i need, by their names:
import {method, const} from 'helpers';
method();
const;
and using them will be much easier. With static class approach i need to always use it as namespace for my methods. So if i need to export some helpers from my module i will always choose second way of exporting. But the problem of this is i can not documentate module. The only solution i found it is defining static class and then export methods from them as one namespace. May be it will be better to provide functionality to documentate module?
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (7 by maintainers)
Replaced jsdoc by esdoc recently. So my code has module tags and most of functions don’t wrapped by classes. My index.js file exports some functions as library functions (lib.function) and some functions as modules functions (lib.module.function). So how can I tell esdoc to document my modules for these cases? Is it possible with esdoc or should I return to jsdoc?
@ProLoser check http://documentation.js.org/ also. It work nicely with any es-next features, even staged ones and can parse types from Flow annotations. Moved to it from esdoc without any regrets, because first order function support is must-have feature to js since it’s not object oriented, but multi-paradigm