Is there a standardized ES6 file extension? If so, what is it?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)