gen-doc-cli
Generate documentation from tag based comments. Gendoc will start at the entry point and recursively crawl through all files and directories. The output will be an array of generate docs in json
format.
Install
npm install gen-doc-cli
Usage
# help message gendoc -hgendoc --help # generate docs gendoc --entry src\\components --output docs.json
API
readdirSync(dir, onDir, onFile, ignoreDir)
Param | Type | Default | Description |
---|---|---|---|
-h, --help | displays the help message | ||
-e, --entry | (filePath: string): void or any | entry point for gendoc | |
-o, --output | (filePath: string): void or any | output location |
Example files
/** * @name isFunction * @param * @returns * @example * isFunction(null) * // => false * * isFunction(() => {}) * // => true */const isFunction = { return typeof fn === "function";}; /** * @name isObject * @param * @returns * @example * isObject(null) * // => false * * isObject({}) * // => true */const isObject = { return obj !== null && ! && typeof obj === "object";}; /** * @name last * @param * @returns * @example * last([]) * // => undefined * * last([1,2]) * // => 2 */const last = { return arr != null && arrlength ? arrarrlength - 1 : undefined;};
TODO
- Add tests
- Support
.gendocrc
- Support multiple entry points from cmd line
- Add the ability to ignore files or directories
- Add file types
Issues
- Files without a name may not be accessable e.g.
.example
- git should be ignored