{
  "meta": {
    "canonicalUrl": "https://timetostable.com/feature/js-modules",
    "bcdVersion": "8.1.11",
    "webFeaturesVersion": "3.48.0"
  },
  "kind": "web-feature",
  "webFeature": {
    "id": "js-modules",
    "name": "JavaScript modules",
    "description": "JavaScript modules allow code to be organized into reusable units. Modules use import to load other modules and export to declare what is available to import from other modules. In HTML, modules are loaded with <script type=\"module\">.",
    "group": "js-modules",
    "groupName": "JavaScript modules",
    "spec": "https://html.spec.whatwg.org/multipage/webappapis.html#javascript-module-script",
    "baseline": "high",
    "baselineLowDate": "2018-05-09",
    "baselineLowDay": 17660,
    "baselineHighDate": "2020-11-09",
    "compatCount": 15,
    "cats": [
      "api",
      "html",
      "javascript"
    ],
    "compatKeysSample": [
      "api.Worklet.ecmascript_modules",
      "html.elements.script.nomodule",
      "html.elements.script.type.module",
      "javascript.operators.import",
      "javascript.operators.import_meta",
      "javascript.operators.import_meta.resolve",
      "javascript.statements.export",
      "javascript.statements.export.arbitrary_module_namespace_identifier_names",
      "javascript.statements.export.default",
      "javascript.statements.export.namespace",
      "javascript.statements.import",
      "javascript.statements.import.arbitrary_module_namespace_identifier_names",
      "javascript.statements.import.import_attributes",
      "javascript.statements.import.worklet_support",
      "svg.elements.script.type.module"
    ],
    "s": {
      "chrome": {
        "v": "61",
        "d": 17414
      },
      "chrome_android": {
        "v": "61",
        "d": 17414
      },
      "edge": {
        "v": "16",
        "d": 17456
      },
      "firefox": {
        "v": "60",
        "d": 17660
      },
      "firefox_android": {
        "v": "60",
        "d": 17660
      },
      "safari": {
        "v": "11",
        "d": 17428
      },
      "safari_ios": {
        "v": "11",
        "d": 17428
      }
    }
  },
  "relatedBcdFeatures": [
    {
      "id": "api.Worklet.ecmascript_modules",
      "cat": "api",
      "spec": "https://html.spec.whatwg.org/multipage/workers.html#module-worker-example",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "80",
          "d": 18296
        },
        "firefox": {
          "v": "114",
          "d": 19514
        },
        "safari": {
          "v": "15",
          "d": 18890
        },
        "edge": {
          "v": "80",
          "d": 18299
        },
        "chrome_android": {
          "v": "80",
          "d": 18296
        },
        "firefox_android": {
          "v": "114",
          "d": 19514
        },
        "safari_ios": {
          "v": "15",
          "d": 18890
        },
        "webview_android": {
          "v": "80",
          "d": 18296
        },
        "webview_ios": {
          "v": "15",
          "d": 18890
        },
        "samsunginternet_android": {
          "v": "13.0",
          "d": 18598
        },
        "opera": {
          "v": "67",
          "d": 18324
        },
        "opera_android": {
          "v": "57",
          "d": 18351
        }
      },
      "notes": [
        {
          "t": "Nested workers support was introduced in Safari 15.5.",
          "b": [
            "safari"
          ]
        },
        {
          "t": "Script loading in nested workers was introduced in Safari 16.4.",
          "b": [
            "safari"
          ]
        },
        {
          "t": "Nested workers support was introduced in Safari on iOS 15.5.",
          "b": [
            "safari_ios"
          ]
        },
        {
          "t": "Script loading in nested workers was introduced in Safari on iOS 16.4.",
          "b": [
            "safari_ios"
          ]
        },
        {
          "t": "Nested workers support was introduced in WebView on iOS 15.5.",
          "b": [
            "webview_ios"
          ]
        },
        {
          "t": "Script loading in nested workers was introduced in WebView on iOS 16.4.",
          "b": [
            "webview_ios"
          ]
        }
      ]
    },
    {
      "id": "html.elements.script.nomodule",
      "cat": "html",
      "spec": "https://html.spec.whatwg.org/multipage/scripting.html#attr-script-nomodule",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "61",
          "d": 17414
        },
        "firefox": {
          "v": "60",
          "d": 17660
        },
        "safari": {
          "v": "11",
          "d": 17428
        },
        "edge": {
          "v": "16",
          "d": 17456
        },
        "chrome_android": {
          "v": "61",
          "d": 17414
        },
        "firefox_android": {
          "v": "60",
          "d": 17660
        },
        "safari_ios": {
          "v": "11",
          "d": 17428
        },
        "webview_android": {
          "v": "61",
          "d": 17414
        },
        "webview_ios": {
          "v": "11",
          "d": 17428
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "48",
          "d": 17436
        },
        "opera_android": {
          "v": "45",
          "d": 17577
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      }
    },
    {
      "id": "html.elements.script.type.module",
      "cat": "html",
      "spec": "https://html.spec.whatwg.org/multipage/webappapis.html#javascript-module-script",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "61",
          "d": 17414
        },
        "firefox": {
          "v": "60",
          "d": 17660
        },
        "safari": {
          "v": "10.1",
          "d": 17252
        },
        "edge": {
          "v": "79",
          "d": 18276
        },
        "chrome_android": {
          "v": "61",
          "d": 17414
        },
        "firefox_android": {
          "v": "60",
          "d": 17660
        },
        "safari_ios": {
          "v": "10.3",
          "d": 17252
        },
        "webview_android": {
          "v": "61",
          "d": 17414
        },
        "webview_ios": {
          "v": "10.3",
          "d": 17252
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "48",
          "d": 17436
        },
        "opera_android": {
          "v": "45",
          "d": 17577
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      },
      "notes": [
        {
          "t": "Module scripts without the <code>async</code> attribute do not load when the page is served as XHTML (<code>application/xhtml+xml</code>). See <a href=\"https://crbug.com/40518469\">bug 40518469</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android",
            "samsunginternet_android",
            "opera",
            "opera_android",
            "oculus"
          ]
        },
        {
          "t": "Module scripts do not load when the page is served as XHTML (<code>application/xhtml+xml</code>).",
          "b": [
            "safari",
            "safari_ios",
            "webview_ios"
          ]
        }
      ]
    },
    {
      "id": "javascript.operators.import",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Operators/import",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-import-calls",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "63",
          "d": 17506
        },
        "firefox": {
          "v": "67",
          "d": 18037
        },
        "safari": {
          "v": "11.1",
          "d": 17633
        },
        "edge": {
          "v": "79",
          "d": 18276
        },
        "chrome_android": {
          "v": "63",
          "d": 17505
        },
        "firefox_android": {
          "v": "67",
          "d": 18037
        },
        "safari_ios": {
          "v": "11.3",
          "d": 17619
        },
        "webview_android": {
          "v": "63",
          "d": 17505
        },
        "webview_ios": {
          "v": "11.3",
          "d": 17619
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "50",
          "d": 17535
        },
        "opera_android": {
          "v": "46",
          "d": 17665
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      },
      "notes": [
        {
          "t": "Bundled Deno applications (using <code>deno compile</code>) do not support dynamic imports",
          "b": [
            "deno"
          ]
        },
        {
          "t": "Dynamic <code>import</code> can be used in either CommonJS or ES module files, to import either CommonJS or ES module files. See Node's <a href=\"https://nodejs.org/api/esm.html#esm_import_expressions\">ECMAScript Modules documentation</a> for more details.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.operators.import_meta",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Operators/import.meta",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#prod-ImportMeta",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "64",
          "d": 17554
        },
        "firefox": {
          "v": "62",
          "d": 17779
        },
        "safari": {
          "v": "11.1",
          "d": 17633
        },
        "edge": {
          "v": "79",
          "d": 18276
        },
        "chrome_android": {
          "v": "64",
          "d": 17554
        },
        "firefox_android": {
          "v": "62",
          "d": 17779
        },
        "safari_ios": {
          "v": "12",
          "d": 17791
        },
        "webview_android": {
          "v": "64",
          "d": 17554
        },
        "webview_ios": {
          "v": "12",
          "d": 17791
        },
        "samsunginternet_android": {
          "v": "9.0",
          "d": 17789
        },
        "opera": {
          "v": "51",
          "d": 17569
        },
        "opera_android": {
          "v": "47",
          "d": 17735
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "10.4.0",
          "d": 17688
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      }
    },
    {
      "id": "javascript.operators.import_meta.resolve",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Operators/import.meta/resolve",
      "spec": "https://html.spec.whatwg.org/multipage/webappapis.html#import-meta-resolve",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "105",
          "d": 19237
        },
        "firefox": {
          "v": "106",
          "d": 19283
        },
        "safari": {
          "v": "16.4",
          "d": 19443
        },
        "edge": {
          "v": "105",
          "d": 19236
        },
        "chrome_android": {
          "v": "105",
          "d": 19237
        },
        "firefox_android": {
          "v": "106",
          "d": 19283
        },
        "safari_ios": {
          "v": "16.4",
          "d": 19443
        },
        "webview_android": {
          "v": "105",
          "d": 19237
        },
        "webview_ios": {
          "v": "16.4",
          "d": 19443
        },
        "samsunginternet_android": {
          "v": "20.0",
          "d": 19398
        },
        "opera": {
          "v": "91",
          "d": 19249
        },
        "opera_android": {
          "v": "72",
          "d": 19286
        },
        "deno": {
          "v": "1.24",
          "d": 19193
        },
        "nodejs": {
          "v": "20.8.0",
          "d": 19629
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "31.2",
          "d": 19737
        }
      },
      "notes": [
        {
          "t": "Returns a <code>URL</code> object instead of a string.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.statements.export",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Statements/export",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-exports",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "61",
          "d": 17414
        },
        "firefox": {
          "v": "60",
          "d": 17660
        },
        "safari": {
          "v": "10.1",
          "d": 17252
        },
        "edge": {
          "v": "16",
          "d": 17456
        },
        "chrome_android": {
          "v": "61",
          "d": 17414
        },
        "firefox_android": {
          "v": "60",
          "d": 17660
        },
        "safari_ios": {
          "v": "10.3",
          "d": 17252
        },
        "webview_android": {
          "v": "61",
          "d": 17414
        },
        "webview_ios": {
          "v": "10.3",
          "d": 17252
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "48",
          "d": 17436
        },
        "opera_android": {
          "v": "45",
          "d": 17577
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      },
      "notes": [
        {
          "t": "Modules must either have a filename ending in <code>.mjs</code>, or the nearest parent <code>package.json</code> file must contain <code>\"type\": \"module\"</code>. See Node's <a href=\"https://nodejs.org/api/esm.html#esm_enabling\">ECMAScript Modules documentation</a> for more details.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.statements.export.arbitrary_module_namespace_identifier_names",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#prod-ModuleExportName",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "88",
          "d": 18646
        },
        "firefox": {
          "v": "87",
          "d": 18709
        },
        "safari": {
          "v": "14.1",
          "d": 18743
        },
        "edge": {
          "v": "88",
          "d": 18648
        },
        "chrome_android": {
          "v": "88",
          "d": 18646
        },
        "firefox_android": {
          "v": "87",
          "d": 18709
        },
        "safari_ios": {
          "v": "14.5",
          "d": 18743
        },
        "webview_android": {
          "v": "88",
          "d": 18646
        },
        "webview_ios": {
          "v": "14.5",
          "d": 18743
        },
        "samsunginternet_android": {
          "v": "15.0",
          "d": 18852
        },
        "opera": {
          "v": "74",
          "d": 18660
        },
        "opera_android": {
          "v": "63",
          "d": 18733
        },
        "deno": {
          "v": "1.6",
          "d": 18604
        },
        "nodejs": {
          "v": "16.0.0",
          "d": 18737
        },
        "bun": {
          "v": "1.0.15",
          "d": 19693
        },
        "oculus": {
          "v": "14.0",
          "d": 18666
        }
      }
    },
    {
      "id": "javascript.statements.export.default",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-exports",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "61",
          "d": 17414
        },
        "firefox": {
          "v": "60",
          "d": 17660
        },
        "safari": {
          "v": "10.1",
          "d": 17252
        },
        "edge": {
          "v": "16",
          "d": 17456
        },
        "chrome_android": {
          "v": "61",
          "d": 17414
        },
        "firefox_android": {
          "v": "60",
          "d": 17660
        },
        "safari_ios": {
          "v": "10.3",
          "d": 17252
        },
        "webview_android": {
          "v": "61",
          "d": 17414
        },
        "webview_ios": {
          "v": "10.3",
          "d": 17252
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "48",
          "d": 17436
        },
        "opera_android": {
          "v": "45",
          "d": 17577
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      },
      "notes": [
        {
          "t": "Modules must either have a filename ending in <code>.mjs</code>, or the nearest parent <code>package.json</code> file must contain <code>\"type\": \"module\"</code>. See Node's <a href=\"https://nodejs.org/api/esm.html#esm_enabling\">ECMAScript Modules documentation</a> for more details.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.statements.export.namespace",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-exports",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "72",
          "d": 17925
        },
        "firefox": {
          "v": "80",
          "d": 18499
        },
        "safari": {
          "v": "14.1",
          "d": 18743
        },
        "edge": {
          "v": "79",
          "d": 18276
        },
        "chrome_android": {
          "v": "72",
          "d": 17925
        },
        "firefox_android": {
          "v": "80",
          "d": 18505
        },
        "safari_ios": {
          "v": "14.5",
          "d": 18743
        },
        "webview_android": {
          "v": "72",
          "d": 17925
        },
        "webview_ios": {
          "v": "14.5",
          "d": 18743
        },
        "samsunginternet_android": {
          "v": "11.0",
          "d": 18235
        },
        "opera": {
          "v": "60",
          "d": 17995
        },
        "opera_android": {
          "v": "51",
          "d": 17976
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "6.0",
          "d": 18120
        }
      },
      "notes": [
        {
          "t": "Modules must either have a filename ending in <code>.mjs</code>, or the nearest parent <code>package.json</code> file must contain <code>\"type\": \"module\"</code>. See Node's <a href=\"https://nodejs.org/api/esm.html#esm_enabling\">ECMAScript Modules documentation</a> for more details.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.statements.import",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Statements/import",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-imports",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "61",
          "d": 17414
        },
        "firefox": {
          "v": "60",
          "d": 17660
        },
        "safari": {
          "v": "10.1",
          "d": 17252
        },
        "edge": {
          "v": "16",
          "d": 17456
        },
        "chrome_android": {
          "v": "61",
          "d": 17414
        },
        "firefox_android": {
          "v": "60",
          "d": 17660
        },
        "safari_ios": {
          "v": "10.3",
          "d": 17252
        },
        "webview_android": {
          "v": "61",
          "d": 17414
        },
        "webview_ios": {
          "v": "10.3",
          "d": 17252
        },
        "samsunginternet_android": {
          "v": "8.0",
          "d": 17730
        },
        "opera": {
          "v": "48",
          "d": 17436
        },
        "opera_android": {
          "v": "45",
          "d": 17577
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "5.0",
          "d": 17713
        }
      },
      "notes": [
        {
          "t": "Modules must either have a filename ending in <code>.mjs</code>, or the nearest parent <code>package.json</code> file must contain <code>\"type\": \"module\"</code>. See Node's <a href=\"https://nodejs.org/api/esm.html#esm_enabling\">ECMAScript Modules documentation</a> for more details.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "javascript.statements.import.arbitrary_module_namespace_identifier_names",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#prod-ModuleExportName",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "88",
          "d": 18646
        },
        "firefox": {
          "v": "87",
          "d": 18709
        },
        "safari": {
          "v": "14.1",
          "d": 18743
        },
        "edge": {
          "v": "88",
          "d": 18648
        },
        "chrome_android": {
          "v": "88",
          "d": 18646
        },
        "firefox_android": {
          "v": "87",
          "d": 18709
        },
        "safari_ios": {
          "v": "14.5",
          "d": 18743
        },
        "webview_android": {
          "v": "88",
          "d": 18646
        },
        "webview_ios": {
          "v": "14.5",
          "d": 18743
        },
        "samsunginternet_android": {
          "v": "15.0",
          "d": 18852
        },
        "opera": {
          "v": "74",
          "d": 18660
        },
        "opera_android": {
          "v": "63",
          "d": 18733
        },
        "deno": {
          "v": "1.6",
          "d": 18604
        },
        "nodejs": {
          "v": "16.0.0",
          "d": 18737
        },
        "bun": {
          "v": "1.0.15",
          "d": 19693
        },
        "oculus": {
          "v": "14.0",
          "d": 18666
        }
      }
    },
    {
      "id": "javascript.statements.import.import_attributes",
      "cat": "javascript",
      "mdn": "JavaScript/Reference/Statements/import/with",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#prod-WithClause",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "chrome": {
          "v": "123",
          "d": 19801
        },
        "firefox": {
          "v": "138",
          "d": 20207
        },
        "safari": {
          "v": "17.2",
          "d": 19702
        },
        "edge": {
          "v": "123",
          "d": 19804
        },
        "chrome_android": {
          "v": "123",
          "d": 19801
        },
        "firefox_android": {
          "v": "138",
          "d": 20207
        },
        "safari_ios": {
          "v": "17.2",
          "d": 19702
        },
        "webview_android": {
          "v": "123",
          "d": 19801
        },
        "webview_ios": {
          "v": "17.2",
          "d": 19702
        },
        "samsunginternet_android": {
          "v": "27.0",
          "d": 20033
        },
        "opera": {
          "v": "109",
          "d": 19809
        },
        "opera_android": {
          "v": "82",
          "d": 19845
        },
        "deno": {
          "v": "1.37",
          "d": 19620
        },
        "nodejs": {
          "v": "20.10.0",
          "d": 19683
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "33",
          "d": 19837
        }
      }
    },
    {
      "id": "javascript.statements.import.worklet_support",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-imports",
      "st": 1,
      "wf": "js-modules",
      "bl": "high",
      "bld": 17660,
      "s": {
        "firefox": {
          "v": "114",
          "d": 19514
        },
        "firefox_android": {
          "v": "114",
          "d": 19514
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        }
      }
    }
  ]
}