WeCodeAcademy

Node.js Introduction

Node.js runs JavaScript outside the browser, using the same V8 engine as Chrome. It is used for web servers, command line tools, build tools and APIs. One language for the front end and the back end is a big reason it became so popular.

ExampleNode.js
console.log("Hello from Node.js!");
console.log(typeof window, typeof process);
console.log(process.version.startsWith("v"));
Output
Hello from Node.js!
undefined object
true

Save code in a file such as app.js and run it with node app.js. There is no window or document in Node: instead you get process, the file system, networking and more. The output under each example is the real output from running it with Node.

Quick check

How do you run app.js with Node?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.