//You can use ES6 import/export in Node.js by simply adding “type”: “module” to your package.json file, like this:
{
"type": "module"
}
//To use “require” in ES module scope, you have to define it. Just two lines of code:
// These lines make "require" available
import { createRequire } from "module";
const require = createRequire(import.meta.url);