tools: doc: improve async workflow of generate.js
Use fs.promises for read and write file
Use unified().process wich is async instead processSync
html and json are write in parallel
errors are logged and exit process with 1
code
Fixes: https://github.com/nodejs/node/issues/30090
Checklist
-
vcbuild test
(Windows) passes -
commit message follows commit guidelines
I'm behind a corporate proxy and get some network errors during the tests, so I hope tests passes with the CI.