Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Node.js style module.exports #168

Closed
bentruyman opened this issue Nov 14, 2015 · 5 comments
Closed

Support for Node.js style module.exports #168

bentruyman opened this issue Nov 14, 2015 · 5 comments

Comments

@bentruyman
Copy link

As of Node.js 4.2.0 and 5.0.0, much of the desired ES6 functionality many developers have without the need for using tools such as babel. However, Node.js does not yet support ES6 module syntax (any may never support it). But we, and I'm sure many others, would love to use esdoc with native ES6 on Node 4.2.0/5.0.0.

@niclashoyer
Copy link

👍

@h13i32maru
Copy link
Member

I do not support module.exports, because ESDoc support ES6. However ESDoc plugin feature might help you. https://esdoc.org/api.html#plugin-feature

@nashton109
Copy link

To get this working for one of my projects, i have a very quick and dirty plugin which is included in via the plugins config in my esdoc file:

exports.onHandleCode = function (ev) {
  ev.data.code = ev.data.code
    .replace(/module\.exports = /g, 'export default ')
    .replace(/exports = /g, 'export default ');
};

@DannyDelott
Copy link

👍

@thetutlage
Copy link

@Orgun109uk Same does not work with

exports = module.exports = {}

As it fails even before reaching the onHandleCode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants