Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Node.js Basics (2014) Introduction to Node.js JavaScript without the Browser

John Coolidge
John Coolidge
12,614 Points

Is Node.js like Python/Ruby/PHP etc.?

So, given Andrew's explanation of Node.js, is it fair to say that Node.js is JavaScript ran like Python or Ruby? I have just a small amount of Python experience and I recall running programs made with Python through the console, like we are doing with Node.js.

2 Answers

Mike Jensen
Mike Jensen
11,718 Points

node.js isn't a server-side language. JavaScript is the language. Node is a execution environment for Javascript that can be run in various places, including on your personal computer or on a server. It allows JavaScript to be used in similar ways to python or ruby for building web applications, because those other languages also have execution environments that can be installed on web servers.

Anthony c
Anthony c
20,907 Points

I think the questioner here is probably looking to ask:

"can node.js be used as a substitute for Python/Ruby/PHP?"

In which the answer is: yes.

Valerio Viperino
Valerio Viperino
6,947 Points

Yes, node.js can be used as a substitute for Python/Ruby/etc..! Actually, Node.js is entirely built upon C++. We use javascript as a higher level of abstraction from the machine, but all of the js we write is converted to C++ which is then converted to machine code. In fact Node.js builds upon the V8 js engine, which is written in C++. For this reason you don't need a browser in order to execute it, and you can run the .js files through the command line. You just need to have installed the node environment on the machine (which does the converting from regular js to C++).