Skip to content

How to document ES2017 features

Lloyd Brookes edited this page Jul 27, 2017 · 2 revisions

To document code using async and await you will need these modules:

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
Clone this wiki locally