Your First Node.js Application

Writing a Simple Hello World Script

Create a file app.js and add the following code:

console.log("Hello, Node.js!");

Run the script using:

node app.js

Using REPL (Read-Eval-Print Loop)

You can also execute JavaScript directly in the Node.js interactive shell:

node
> console.log("Hello, Node.js!");