Node.js Introduction
Node.js is a runtime for JavaScript. Version v24.22.1 runs the examples in this course.
A greeting
This line prints a greeting.
console.log("Hello, Node!");The Node version
process holds facts about the running program. This line prints its version.
console.log(process.version);Example
console.log("Hello, Node!");
console.log(process.version);Key points
- Node.js runs JavaScript outside a browser.
- A browser is a program that shows web pages.
- A runtime is a program that runs code.
- JavaScript is the language Node.js runs.
- Node.js reads JavaScript and runs it line by line.
- Node.js runs on a computer, not only in a browser.
In this example, the first line prints Hello, Node!. The second line prints the running Node.js version. The version is v24.22.1. process holds facts about the running program.
Note
Node.js is not a browser, so it shows no web pages.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What is Node.js?