Koray Tugay
Koray Tugay

Reputation: 23834

Is Node.js a JavaScript runtime environment or an EcmaScript environment?

According to https://nodejs.org/en/

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

However, according to this answer, JavaScript is:

JavaScript = ECMAScript + DOM API;

and there is no DOM in Node.js runtime. (or is there?) Also quoting from the book: Professional JavaScript for Web Developers:

Though JavaScript and ECMAScript are often used synonymously, JavaScript is much more than just what is defined in ECMA-262. Indeed, a complete JavaScript implementation is made up of the following three distinct parts:

  • The Core (ECMAScript)
  • The Document Object Model (DOM)
  • The Browser Object Model (BOM)

which supports the answer I link to.

Considering the facts above, isn 't it correct to say Node.js is a ECMAScript runtime? If not, what do we need to remove (or add?) if we wanted to fork Node.js and make it an ECMAScript runtime instead of a JavaScript runtime?

Upvotes: 8

Views: 850

Answers (2)

Nitin Sharma
Nitin Sharma

Reputation: 29

There are many JavaScript run time environment:

  1. Browsers
  2. Node.js
  3. Deno
  4. Edge Workers
  5. Moddable
  6. Databses
  7. Productivity Software

source: https://www.youtube.com/watch?v=JN7UjvceOlw

Upvotes: -2

Peter Olson
Peter Olson

Reputation: 143007

The difference between JavaScript and ECMAScript is just a pedantic difference that most people don't really care about. Technically the official language name according to the standard is ECMAScript, but for historical and convenience reasons people almost always call it "JavaScript". I've never met anybody who calls themselves an "ECMAScript developer".

As far as I know, JavaScript doesn't even have an official formal definition. While ECMAScript has a prescriptive definition with versions that are formally defined by their various specifications, the meaning of "JavaScript" is essentially defined by how people use it.

For this reason, Node.js advertises itself as a JavaScript runtime. It might be more "technically correct" to call it an ECMAScript runtime, but it would be more confusing for most people to advertise it that way.

Upvotes: 9

Related Questions