Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to say nodeJS is built on the V8 engine?

I'm beginner to MEAN stack, while studying NodeJS, I'm came up with the following statement that's taking my mind

Node.js is a very powerful JavaScript-based framework/platform built on Google Chrome's JavaScript V8 Engine.

but what exactly does it mean by

built on Google Chrome's JavaScript V8 Engine.

and if it's built on Chrome's JS V8 Engine, why does it works on Firefox as well?

like image 795
James LeBorn Avatar asked Dec 30 '16 16:12

James LeBorn


People also ask

What is Node js V8 engine?

What is V8? V8 is Google's open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node. js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors.

Does node js run on V8 engine?

V8 is required for the current Node. js engine to function. In the absence of V8, it wouldn't have a JavaScript engine, and thus wouldn't be able to run JavaScript code. The V8 interface between C++ and JavaScript is used by the native code bindings that come with Node.

What engine does node js run on?

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

What is the difference between node js and V8?

V8 is a browser engine whereas nodejs is built on top of V8 which is a runtime environment that gives javascript the power to run at the server-side.


1 Answers

MEAN stack, reorganized from back to front:

  • MongoDB: data persistence, stores data for later retrieval
  • Node.js: web application server, responds to requests from clients
  • Express: web application framework, reduces Node boilerplate
  • Angular.js: browser framework

So Node.js does not "work on Firefox" (it doesn't work on Google Chrome either): its a server-side technology. Think of it as a replacement for Python/Ruby/Java in that role. So it can/does respond to requests from all sorts of clients (like Google Chrome and Firefox).

What the "built on V8" means is that it uses the same JavaScript interpreter/just-in-time compiler as Google Chrome. But the similarities with chrome pretty much stop there: Node has no rendering engine/css parser/DOM but does have things you need in a server like an HTTP library and a filesystem API.

Also, and I mean no offence: we all started where you are, the fact that you are even asking the question (which again is not a bad thing!) means that building on a stack like MEAN is over your head. The documentation is going to assume that you know things you seem to not know. I strongly recommend furthering your understanding of JavaScript and Node through some tutorials and barebones test apps before trying to throw databases and frameworks into the mix.

like image 185
Jared Smith Avatar answered Oct 14 '22 05:10

Jared Smith