Is top-level await
still not supported in Node.js (Jan 2020, Node.js 13.5.0)?
I've tried some tutorials, like this one, but still no luck, always getting the same error:
D:\NodeJS>node --experimental-modules test.js
(node:17724) ExperimentalWarning: The ESM module loader is experimental.
file:///D:/NodeJS/test.js:9
await test();
^^^^^
SyntaxError: Unexpected reserved word
The entire file content:
function test() {
}
await test();
I have tried using "type": "module"
in package.json
, and renaming file into test.mjs
, but still the same error, even with the latest Node.js 13.5.0
What am I doing wrong?