Not an answer here and more like a comment, sorry but I can't comment.
In node V10, you can use the flag --experimental-modules
to tell Nodejs you want to use import
. But your entry script should end with .mjs
.
Note this is still an experimental thing and should not be used in production.
// main.mjs
import utils from './utils.js'
utils.print();
// utils.js
module.exports={
print:function(){console.log('print called')}
}