You can learn how to Node.js’s ES6 “import” statements at this Stack Overflow URL.
In short, there are two (2) ways:
- Save the file with an *
.mjs
extension, or - Add
{ "type": "module" }
in the nearestpackage.json
You can learn how to Node.js’s ES6 “import” statements at this Stack Overflow URL.
In short, there are two (2) ways:
.mjs
extension, or{ "type": "module" }
in the nearest package.json