'Difference between JavaScript shell and node.js

I have been developing in Node.js for some time now. Today, I came across this article Introduction to the JavaScript shell - Mozilla | MDN

It talks about javascript shell and goes onto say that it can execute javascript programs from a file as well.

I was able to research and understand V8 and spydermonkey.

I want to know the difference between Node.js and the javascript shell talked about in this article since it says that the shell can execute javascript programs on its own.

Do they only differ in that the node.js uses a V8 engine while the other uses a spidermonkey?

if so then why is it that node.js is so popularly used for writing Server Side JavaScript?

I couldn't exactly find what I was looking for on the Internet. either google showed me difference between spidermonkey and v8 or some forums on "difference between javascript and node.js" and since I am a new developer its really hard for me to understand,

Can spidermonkey be used to achieve the same?



Solution 1:[1]

JavaScript is a language. node.js is not a language or a special dialect of JavaScript - it's just a thingamabob that runs normal JavaScript.

All browsers have JavaScript engines that run the JavaScript of web pages. Firefox has an engine called Spidermonkey, Safari has JavaScriptCore, and Chrome has an engine called V8.

Node.js is simply the V8 engine bundled with some libraries to do I/O and networking, so that you can use JavaScript outside of the browser, to create shell scripts, backend services or run on hardware (https://tessel.io/).

Credits : https://www.quora.com/What-is-the-difference-between-JavaScript-and-Node-js

I hope that helped clearing out the basic difference between them. The specifics you required are not answered here.

Solution 2:[2]

Node.js enables JavaScript to be used for server-side scripting, and runs scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

Source: https://en.wikipedia.org/wiki/Node.js

Obviously the shell can not serve HTML web pages by itself.

In addition, Node.js is asynchronous, and non-blocking, meaning it can serve multiple requests and host multiple processes simultaneously.

EDIT: provided source.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Darshit Pandit
Solution 2