I'm wondering if there's a standardized file extension for ES6 yet. So far I've seen .es6
and .es6.js
as two options, but I'm curious if one is generally better supported by third party packages and tools. And if Mozilla is leaning a particular direction.
JavaScript ES6 (also known as ECMAScript 2015 or ECMAScript 6) is the newer version of JavaScript that was introduced in 2015. ECMAScript is the standard that JavaScript programming language uses. ECMAScript provides the specification on how JavaScript programming language should work.
JavaScript files have the file extension .js.
What is ES6? ES6 stands for ECMAScript 6. ECMAScript was created to standardize JavaScript, and ES6 is the 6th version of ECMAScript, it was published in 2015, and is also known as ECMAScript 2015.
ES6 Syntax. EcmaScript (ES) is a standardised scripting language for JavaScript (JS). The current ES version supported in modern browsers is ES5. However, ES6 tackles a lot of the limitations of the core language, making it easier for devs to code.
There's no formal ES6/JS extension, although majority of people seem to prefer .js
. ECMAScript specific suffixes aren't common.
Mozilla is using two extensions within Firefox and FirefoxOS: .js
and .jsm
. No ECMA Script specific suffixes.
For Gecko (the layout engine written largely in JS), they use both .js
and .jsm
. Example: one of the DOM modules source code.
In some other subprojects, such as Gaia, they use .js
only. Example: "system" app for Firefox OS.
Note: .jsm
is something specific to Gecko - it's a Javascript module.
Note: ECMAScript 6 is a standard that is later implemented in Firefox as Javascript. So those two terms are closely related, and are almost synonyms (source).
Heads up: source code on the Gecko side has the syntax that is plain JS with some extensions - some of which ended up in ECMA Script 6, some not. In general, though, Mozillians tend to follow ECMA Script spec closely. Possible differences are listed here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With