Skip to content

How to document ES2017 features

Lloyd Brookes edited this page Jan 22, 2018 · 2 revisions

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:

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