Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "server" in server-side javascript like NodeJS?

Is it not a Javascript engine hosted by the browser on the client machine itself?

like image 391
Divs Avatar asked Dec 29 '15 12:12

Divs


People also ask

Is node js server side JavaScript?

Node. js is a server-side JavaScript run-time environment. It's open-source, including Google's V8 engine, libuv for cross-platform compatibility, and a core library.

What is a JavaScript server?

JavaScript is the server-side language used to develop services for the Opera Unite feature of the Opera browser. This is a server built into the browser. The JavaScript API includes local file access to a virtual sandboxed file-system and persistent storage via persistent global variables.

Which server is used for JavaScript?

Server Side JavaScript (SSJS) is an extended version of JavaScript that enables back-end access to databases, file systems, and servers. Server side javascript, is javascript code running over a server local resources , it's just like C# or Java, but the syntax is based on JavaScript. A good example of this is Node.

Which server is used to run node JS?

You can use IIS or Apache to run Node. js web application but it is recommended to use Node. js web server.


Video Answer


2 Answers

No, it isn't.

Server generally has two meanings:

  1. A piece of software that listens for network requests and then responds to them
  2. A computer running such a piece of software

A Node.JS server can be either of those.

In web programming, a Node.JS server takes the place of Perl, Python, Ruby, PHP, Scala, etc. (And like those other languages, Node.JS lets you use JavaScript for non-server and non-web purposes).

Generally the server itself is run directly from Node (e.g. with this library) rather than being embedded in another server like Apache (as is most common for PHP).

A browser doesn't need to be involved at all. If one is, then it will probably be one acting as a client and making a request to the server. That said, tools like PhantomJS can allow a browser to be driven from Node (and other programming languages).

like image 147
Quentin Avatar answered Sep 22 '22 15:09

Quentin


From here:

Server-side JavaScript (SSJS) refers to JavaScript that runs on server-side and is therefore not downloaded to the browser. This term is used to differentiate it from regular JavaScript, which is predominantly used on the client-side (also referred to as client-side JavaScript or CSJS for short).

like image 45
Rahul Tripathi Avatar answered Sep 22 '22 15:09

Rahul Tripathi