I would like to use jsdoc
module to extract documentation entries from some source code.
I have installed jsdoc
module and I can use jsdoc
in the command line.
But when I require("jsdoc")
in my code, nodejs throws an error saying Cannot find module 'jsdoc'
.
I have nodejs v0.8.25 and JSDoc 3.3.0-alpha2. It is installed both locally and globally.
I can use jsdoc
command and I have jsdoc
in my node_modules
folder.
I cannot see where the problem is.
Where can I find some documentation about jsdoc
other than how to use it in the command line interface or how to document js source code. I would like some API documentation.
I was looking to use jsdoc as a library too, and I stumbled on the same issue as you did. You have done nothing wrong, it was just never intended to be used as a library.
There is an issue on the jsdoc's github project page relating to this. Hegemonic, the main contributor of JSDoc said:
JSDoc isn't really designed to be used as a library
You might want to express your desire to for creating an API for nodejs on the issue linked above.
The require('jsdoc')
fails because there is no main
field declared in the jsdoc's package.json
. It might default to 'index.js' or 'main.js', but there is no such file either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With