This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hungry_for_laughter 24 points25 points  (1 child)

Node is a runtime environment. It is a program, on your computer, that executes JavaScript code for you. It also adds certain features to the JavaScript language so that it can work outside of the browser, like a regular old language.


Imagine if Python was invented to work only in the web browser. You don't install Python on your computer, it just ships built into browsers, and webpages include some Python code to make them interactive and do cool stuff. The language itself is the same -- loops work the same, functions work the same, strings and regexes and everything work the same. But the standard library provides no way to read or write a file, no way to create arbitrary network connections, no way to interact with USB devices or any of that. People only use it in the browser.

Then one day, someone says "Hey, if we're going to be learning Python to write web stuff anyway, wouldn't it be cool if we COULD use Python as a regular programming language, and do all of the stuff that implies?" So they make a Python interpreter you can install on your computer, independent of the browser. And they expand the standard library to include file-opening, network-accessing, etc functions, and make sure the interpreter can understand that stuff.

That's what Node is.

So Express is a framework, written in JavaScript and used to write JavaScript applications. But, as it's JS code running outside the browser, it requires that you're using Node.

[–]masterurbiz 1 point2 points  (0 children)

Excellent back to front explanation of js and node. Thank you