How to document ES2017 features - jsdoc2md/jsdoc-to-markdown GitHub Wiki
IMPORTANT: This page is only relevant if you use an old version of jsdoc2md. Beginning in jsdoc2md v4, ES2017 is supported natively.
To document code using async
and await
you will need these modules:
- https://github.com/ctumolosus/jsdoc-babel
- http://babeljs.io/docs/plugins/preset-es2015/
- http://babeljs.io/docs/plugins/transform-async-to-generator/
1. Install them:
`$ npm i jsdoc-babel babel-preset-es2015 babel-plugin-transform-async-to-generator --save-dev`
2. Create this jsdoc config file:
{
"plugins": ["node_modules/jsdoc-babel"],
"babel": {
"presets": [ "es2015" ],
"plugins": [ "transform-async-to-generator" ]
}
}
3. Run jsdoc2md like this: (use --conf
for jsdoc2md@^1)
$ jsdoc2md --configure jsdoc.json lib/your-code.js