Can I use jsdoc.cmd, from a script of package.json?

53 views Asked by At

This is the first time that I try to generate a doc from js. It looks like on windows, jsdoc relies on a ps1 files. As I am not security focused enough lately to allow powershell scripts on my computer during all development time, I am looking for a way not to have to do that. So I want to use the jsdoc.cmd version.

At first I had this problem: I had an output directory for js files starting with an undescore, and I hadn't made the pattern in conf.json > source > excludePattern to allow that. Not that's solved and Then that problem: I had my command did not pointed to the directory of the js files (I thought that it would find them automatically, like typescript does; well, apparenly, jsdoc doesn't). But now I figured it out. To use the cmd version of jsdoc, the correct command is:

"node_modules/.bin/jsdoc.cmd" " [name of your js dir without underscores unless that's not fobidden]" -c "config.json" "README.md"

for execution in a command line terminal, not in a powshershell terminal.

Alright, but how do I use this line from the package.json of my node project? So that the doc compiles automatically from npm... I tried this, but it outputs (translation) "The DNS server is not authoritative for the zone.":***

"scripts": {
  "test": "npx tsc && npx cmd.exe \"node_modules/.bin/jsdoc.cmd\" _JS -c docconfig.json ../README.md && node index.js"
}

(I'm new at experimenting with backend, so if possible I'd aprpeciate baby steps. Thanks.)

0

There are 0 answers