Loading topic
import and export before any code2 min readlet, const, and var, and how to run a file in a browser or Node.js. It also assumes you have read the previous chapter on module scope.2 min readmath.js from the Named Exports chapter. That file exports PI, area, and perimeter.2 min read./math.js need a full path with a file extension. It also assumes you can open a page in a browser and read its developer console.1 min readnode from a terminal and know what a package.json file is. It also builds on the earlier chapters about export and import syntax and about module specifiers.2 min readlet and const.2 min read./math.js resolve.2 min readimport and export, module namespace objects, and async/await. A static import declaration loads its module before any of your code runs. Sometimes you want to wait instead: load a heavy charting library only when the user asks for a chart, or pick a tra2 min readasync/await work, and that you have seen how modules are linked and evaluated. Top-level await lets a module use await outside any function. The module pauses its own evaluation until the promise settles. Any module that imports it also waits.2 min readURL class and async/await.2 min read.mjs and .cjs extensions or the "type" field in package.json. It also assumes you know default imports and import.meta.url. Many npm packages still use CommonJS (CJS), the older format with `requi2 min readlet and const behave before their declaration runs.2 min read