{
  "meta": {
    "canonicalUrl": "https://timetostable.com/feature/js-modules-workers",
    "bcdVersion": "8.1.11",
    "webFeaturesVersion": "3.48.0"
  },
  "kind": "web-feature",
  "webFeature": {
    "id": "js-modules-workers",
    "name": "JavaScript modules in workers",
    "description": "The Worker() constructor accepts { type: \"module\" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in workers.",
    "group": "js-modules",
    "groupName": "JavaScript modules",
    "spec": "https://html.spec.whatwg.org/multipage/workers.html#dom-worker-dev",
    "baseline": "high",
    "baselineLowDate": "2023-06-06",
    "baselineLowDay": 19514,
    "baselineHighDate": "2025-12-06",
    "compatCount": 4,
    "cats": [
      "api",
      "javascript"
    ],
    "compatKeysSample": [
      "api.Worker.Worker.ecmascript_modules",
      "api.Worker.Worker.options_type_parameter",
      "javascript.operators.import.worker_support",
      "javascript.statements.import.worker_support"
    ],
    "s": {
      "chrome": {
        "v": "80",
        "d": 18296
      },
      "chrome_android": {
        "v": "80",
        "d": 18296
      },
      "edge": {
        "v": "80",
        "d": 18299
      },
      "firefox": {
        "v": "114",
        "d": 19514
      },
      "firefox_android": {
        "v": "114",
        "d": 19514
      },
      "safari": {
        "v": "15",
        "d": 18890
      },
      "safari_ios": {
        "v": "15",
        "d": 18890
      }
    }
  },
  "relatedBcdFeatures": [
    {
      "id": "api.Worker.Worker.ecmascript_modules",
      "cat": "api",
      "spec": "https://html.spec.whatwg.org/multipage/workers.html#module-worker-example",
      "st": 1,
      "wf": "js-modules-workers",
      "bl": "high",
      "bld": 19514,
      "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
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "p": [
            "12.17.0",
            18408
          ]
        },
        "oculus": {
          "v": "9.0",
          "d": 18376
        }
      },
      "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"
          ]
        },
        {
          "t": "ECMAScript modules are enabled for files ending with <code>.mjs</code> and for files ending with <code>.js</code> when the nearest parent <code>package.json</code> file contains a top-level field <code>\"type\"</code> with a value of <code>\"module\"</code>.",
          "b": [
            "nodejs"
          ]
        }
      ]
    },
    {
      "id": "api.Worker.Worker.options_type_parameter",
      "cat": "api",
      "spec": "https://html.spec.whatwg.org/multipage/workers.html#dom-workeroptions-type",
      "st": 1,
      "wf": "js-modules-workers",
      "bl": "high",
      "bld": 19514,
      "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
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "oculus": {
          "v": "9.0",
          "d": 18376
        }
      },
      "notes": [
        {
          "t": "Only supports <code>module</code>",
          "b": [
            "deno"
          ]
        }
      ]
    },
    {
      "id": "javascript.operators.import.worker_support",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-import-calls",
      "st": 1,
      "wf": "js-modules-workers",
      "bl": "high",
      "bld": 19514,
      "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
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "nodejs": {
          "v": "13.2.0",
          "d": 18221
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "9.0",
          "d": 18376
        }
      }
    },
    {
      "id": "javascript.statements.import.worker_support",
      "cat": "javascript",
      "spec": "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-imports",
      "st": 1,
      "wf": "js-modules-workers",
      "bl": "high",
      "bld": 19514,
      "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
        },
        "deno": {
          "v": "1.0",
          "d": 18395
        },
        "bun": {
          "v": "1.0.0",
          "d": 19608
        },
        "oculus": {
          "v": "9.0",
          "d": 18376
        }
      }
    }
  ]
}