Package files contain information that can be useful for your project's documentation, such as the project's name and version number. JSDoc can automatically use information from your project's package.json
file when it generates documentation. For example, the default template shows the project's name and version number in the documentation.
There are two ways to incorporate a package.json
file into your documentation:
package.json
file. JSDoc will use the first package.json
file that it finds in your source paths.-P/--package
command-line option, specifying the path to your package.json
file. This option is available in JSDoc 3.3.0 and later.The -P/--package
command-line option takes precedence over your source paths. If you use the -P/--package
command-line option, JSDoc will ignore any package.json
files in your source paths.
The package.json
file must use npm's package format.
jsdoc path/to/js path/to/package/package.json
jsdoc --package path/to/package/package-docs.json path/to/js
© 2011–2017 the contributors to the JSDoc 3 documentation project
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://usejsdoc.org/about-including-package.html