Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 433
Ashwin K Joseph Avatar asked Oct 20 '25 21:10

Ashwin K Joseph


1 Answers

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.

like image 72
Darshit Pandit Avatar answered Oct 22 '25 10:10

Darshit Pandit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!