-5

Okay noob question.

  1. What is node.js?
  2. What is its purpose and where is it used?

They say that it is a server-side technology used to perform parallel operations. Google V8 is the parser and the language is Javascript but I thought that Javascript does not work on server-side. How exactly does node.js do this?

Sorry I tried to look up a good answer for it but I couldn't find any good explanation of node.js. I don't quite get what node.js does from these posts either:

  1. What is Node.js?
  2. What is node.js based on, under the hood?
Community
  • 1
  • 1
blank_kuma
  • 335
  • 6
  • 16
  • 1
    *"I thought that Javascript does not work on server-side"* Well, you are wrong in that case. What made you think that? – Felix Kling Apr 14 '15 at 23:39
  • I didn't understand http://stackoverflow.com/questions/1884724/what-is-node-js so I thought I would create another question hoping that someone would help me understand what node.js is? I wrote that in the lower part of my question. – blank_kuma Apr 14 '15 at 23:42
  • 2
    Not sure what is there to understand - JavaScript is a language, just like PHP, Java, Ruby, etc. Node.js is a runtime environment that uses JavaScript as a language and provides the developer with tools necessary to interact with the world - access to filesystem, environment, TCP/UDP communications etc. – Robert Rossmann Apr 14 '15 at 23:42
  • 1
    Node.js is V8 + I/O + a standard library... not sure what exactly you want to know. – Felix Kling Apr 14 '15 at 23:43
  • 1
    For a browser guy/gal, I think the most important revelation of the day should be that JavaScript is a language (the syntax) and what browsers give you is the DOM, your browser's runtime environment. These, however, are two completely separate things. – Robert Rossmann Apr 14 '15 at 23:45
  • @RobertRossmann okay that explanation was a bit helpful. It's just a technology used by google servers to run concurrent processes then? are these processes the requests made to the server or the applications run on the server? – blank_kuma Apr 14 '15 at 23:46
  • Node.js has nothing to do with Google. The V8 engine is open source. It could as well use Mozilla's Spidermonkey engine. – Felix Kling Apr 14 '15 at 23:47
  • I probably overthought the concept of node.js. seems like it allows people to write webs servers and how it handles data. @FelixKling thanks for pointing out that javascript could be used on servers. I was confused before since I had read somewhere that javascript cannot be used to interact with servers, so I thought that it couldn't be used on servers either. – blank_kuma Apr 15 '15 at 00:06
  • 2
    There are limitations how JavaScript executed in a *browser* can communicate with other servers. However, those are restrictions imposed by the browser environment and the API it provides, for security reasons. – Felix Kling Apr 15 '15 at 00:08
  • i guessed as much. otherwise scripts could be written to interfere with the servers on the client side. – blank_kuma Apr 15 '15 at 00:09
  • They can be. That's why security, validation, and the like exist. Client-side JS is strict about how it can interact with the client it's running on, though. – Dave Newton Apr 15 '15 at 00:12

1 Answers1

4
  1. Node.js is a platform for the JavaScript language that is centered around asynchronous network programming. It contains a set of libraries to help you develop server-side applications with JavaScript

  2. Under the hood, Node.js is running on V8, a JavaScript engine developed by Google.

Hope this helps.

James Parsons
  • 6,097
  • 12
  • 68
  • 108