$ cnpm install jsdoc-api
A programmatic interface for jsdoc3 with a few features:
> const jsdoc = require('jsdoc-api')
> jsdoc.explainSync({ source: '/** example doclet */ \n var example = true' })
[ { comment: '/** example doclet *∕',
meta:
{ range: [ 28, 42 ],
filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js',
lineno: 2,
path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T',
code:
{ id: 'astnode100000002',
name: 'example',
type: 'Literal',
value: true } },
description: 'example doclet',
name: 'example',
longname: 'example',
kind: 'member',
scope: 'global' },
{ kind: 'package',
longname: 'package:undefined',
files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ]
cache-pointArray.<object>Promisestring | Array.<string>stringbooleanstringstringstringstringbooleanstringbooleanstringbooleanstringstringstringcache-pointThe cache-point instance used when cache: true is specified on .explain() or .explainSync().
Kind: static property of jsdoc-api
Array.<object>Returns jsdoc explain output.
Kind: static method of jsdoc-api
Prerequisite: Requires node v0.12 or above
| Param | Type |
|---|---|
| [options] | JsdocOptions |
PromiseReturns a promise for the jsdoc explain output.
Kind: static method of jsdoc-api
Fulfil: object[] - jsdoc explain output
| Param | Type |
|---|---|
| [options] | JsdocOptions |
Render jsdoc documentation.
Kind: static method of jsdoc-api
Prerequisite: Requires node v0.12 or above
| Param | Type |
|---|---|
| [options] | JsdocOptions |
Example
jsdoc.renderSync({ files: 'lib/*', destination: 'api-docs' })
The jsdoc options, common for all operations.
Kind: inner class of jsdoc-api
string | Array.<string>stringbooleanstringstringstringstringbooleanstringbooleanstringbooleanstringstringstringstring | Array.<string>One or more filenames to process. Either this or source must be supplied.
Kind: instance property of JsdocOptions
stringA string containing source code to process. Either this or files must be supplied.
Kind: instance property of JsdocOptions
booleanSet to true to cache the output - future invocations with the same input will return immediately.
Kind: instance property of JsdocOptions
stringOnly display symbols with the given access: "public", "protected", "private" or "undefined", or "all" for all access levels. Default: all except "private".
Kind: instance property of JsdocOptions
stringThe path to the configuration file. Default: path/to/jsdoc/conf.json.
Kind: instance property of JsdocOptions
stringThe path to the output folder. Use "console" to dump data to the console. Default: ./out/.
Kind: instance property of JsdocOptions
stringAssume this encoding when reading all source files. Default: utf8.
Kind: instance property of JsdocOptions
booleanDisplay symbols marked with the @private tag. Equivalent to "--access all". Default: false.
Kind: instance property of JsdocOptions
stringThe path to the project's package file. Default: path/to/sourcefiles/package.json
Kind: instance property of JsdocOptions
booleanTreat errors as fatal errors, and treat warnings as errors. Default: false.
Kind: instance property of JsdocOptions
stringA query string to parse and store in jsdoc.env.opts.query. Example: foo=bar&baz=true.
Kind: instance property of JsdocOptions
booleanRecurse into subdirectories when scanning for source files and tutorials.
Kind: instance property of JsdocOptions
stringThe path to the project's README file. Default: path/to/sourcefiles/README.md.
Kind: instance property of JsdocOptions
stringThe path to the template to use. Default: path/to/jsdoc/templates/default.
Kind: instance property of JsdocOptions
stringDirectory in which JSDoc should search for tutorials.
Kind: instance property of JsdocOptions
© 2015-20 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.
Copyright 2013 - present © cnpmjs.org