This is an example for using ES modules with Node.js 12:
- Add package.json file (using 'npm init' command)
- Add "type": "module" to package.json, and Node.js will treat all .js files as ES modules
- Run program with the command 'node --experimental-modules main.js'
- Notice - with --experimental-modules file extensions are mandatory in import statements: import '.file.js', not import './file'.
-
Notifications
You must be signed in to change notification settings - Fork 0
Suzizaher/ESModules
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published