On Node 13.8 I\'m trying to use import / export.
EG:
import {ChatClient, Message, MessageParser} from \'./chat-client/module.js\';
But when i d
As the documentation says:
No require, exports, module.exports, __filename, __dirname
These CommonJS variables are not available in ES modules.
https://nodejs.org/api/esm.html#esm_no_require_exports_module_exports_filename_dirname
You can't use both natively. If you want to do that use Babel to transpile your code.
Several points:
.mjs
instead of .js
.require
.