ES modules
With ES2015, ECMAScript introduced official language support for modules. Hence, it is now possible to define modules using a standard module format called ES Modules (ESM).
This new standard is very well supported (https://caniuse.com/#feat=es6-module) by modern web browsers such as Google Chrome, Mozilla Firefox, Microsoft Edge, Safari, and Opera. Thanks to that support, it is now possible to load standard modules in the browser using the following syntax: <script type="module">. At the time of writing, support for ES modules is still experimental in Node.js: https://nodejs.org/api/esm.html.
ESM uses the import and export reserved keywords. Using the export keyword in a module allows you to make the corresponding symbol (that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access