ES modules have asynchronous execution, so we use import() to load an ESmodule from a commonJS module but using require to load an ESmodule is not supported.
So we have two options,
1. Rename .js files to .mjs
2. Update the root package.json file, or add a package.json to the folder that contains ES modules and specify the type as a module.
There is another possibility that is enabling the ES module in the root package.json file, and then renaming all CommonJS module Files to use the .cjs extension.
This addition personally for me is a good practice of coding using the new ES modules. Hope new inclusions like this come frequently in later stage node updates.
For more learning – Youtube -https://www.youtube.com/watch?v=WZQc7RUAg18