DEV Community

Discussion on: ES6 is the Node way to go

Collapse
 
ijash profile image
Jastria Rahmat

can it be combined? say, i got npm package that uses module.export. can it be imported by using import statement?

Collapse
 
mrinasugosh profile image
Mrinalini Sugosh (Mrina)

Yes it should work with module.export.
Just one thing to note:
Many people consider module.exports = ... to be equivalent to export default main; That's not quite true though, or at least not how Babel does it.

ES6 default exports are actually also named exports, except that default is a "reserved" name and there is special syntax support for it as a heads up