ES Module

noun

say it: “EE-ESS MOJ-ool” /ˌiːˈɛs ˈmɒdʒuːl/

A JavaScript file that shares only what it marks with export, and brings in other files' code with import.

What is ES Module in JavaScript?

ES Module — A JavaScript file using import and export to declare dependencies and public values.

export function total(price, quantity) {
    return price * quantity;
}

In a sentence

  • “I moved the unit conversions into their own ES module, convert.js, and imported them where I need them.”

Level: Journeyman · More JavaScript terms at this level

Updated