43

As per the definition mentioned on https://nodejs.org/

Node.js is a platform built on Chrome's JavaScript run-time for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Can any one please help me understand what the JavaScript run-time exactly means?

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
Yamini
  • 523
  • 1
  • 5
  • 7
  • 15
    Javascript runtime refers to *where* your javascript code is executed when you run it. That said, javascript can be executed on google chrome, in which case your javascript runtime is v8, if on mozilla - it is spidermonkey, if IE - then its chakra and if on node, again its v8. – kaizer1v Oct 12 '18 at 09:07
  • 2
    @kaizer1v's answer is the best one for me. This is could be the accepted answer. – alramdein Sep 15 '21 at 13:56
  • @kaizer1v isn't chrome's v8 a javascript engine? Runtime examples are nodejs, deno. Nodejs as a runtime environment runs on top of v8 engine. – duduwe Jul 08 '22 at 12:06
  • This question is not at all a duplicate. This question is "What is a Javascript Runtime?" The linked to question is "What runs at Javascript run time?" Two different things. Amazingly, neither really answers the first question. – Raydot Mar 14 '23 at 22:46

4 Answers4

15

Chrome's javascript runtime is Google's V8 engine which was developed by Google to be used with Google Chrome.

It compiles the javascript code to native machine code instead of interpreting bytecode which gives a major performance boost to javascript (which is traditionally very slow compared to other high level languages).

Node.js contains libuv to handle asynchronous events. V8 provides the run-time for JavaScript.

prairiedogg
  • 6,323
  • 8
  • 44
  • 52
Akshat Goel
  • 736
  • 2
  • 6
  • 19
12

Maybe it's referring to Google's V8 engine.

  • It is an engine for processing JavaScript in the browser and is used by Google Chrome.
  • It's open source.
  • And it's written in C++.
  • It works on several platforms including mobile and embedded devices.

For more information see: https://code.google.com/p/v8/

If you google for "chrome javascript runtime", you will get all these links to V8.

Mustaghees
  • 506
  • 6
  • 16
  • 3
    But for NodeJS, we see a different statement "Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.". The reference is https://nodejs.org/en/ – daydreamer Jan 08 '20 at 19:00
1

It is a virtual machine which interprets and executes JavaScript mostly on browser. In fact Node.js is a javascript runtime based library.

Identity1
  • 1,139
  • 16
  • 33
-2

The JavaScript Runtime (JsRT) APIs provide a way for desktop, Windows Store, and server-side applications running on the Windows operating system to add scripting capabilities to an app by using the standards-based Chakra JavaScript engine that is also utilized by Microsoft Edge and Internet Explorer. These APIs are available on Windows 10 and any version of the Windows operating system that has Internet Explorer version 11.0 installed on the machine.