codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🟢

Node.js

3 / 63 topics
1Getting Started with Node.js2Node.js Installation3Hello World Program4Node.js Modules5Node Package Manager (NPM)
Tutorials/Node.js/Hello World Program
🟢Node.js

Hello World Program

Updated 2026-05-15
10 min read

Hello World Program

Introduction

Welcome to the world of Node.js! In this tutorial, we'll start with one of the most basic programs you can write in any programming language: a "Hello, World!" application. This simple program will help us understand the basics of setting up a Node.js environment and running a script.

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript code outside of the browser, enabling server-side scripting and building scalable network applications.

Concept

In this section, we'll break down what it takes to create a "Hello, World!" program in Node.js:

  1. Node.js Installation: Ensure you have Node.js installed on your machine.
  2. Creating a JavaScript File: Write the code for our "Hello, World!" application.
  3. Running the Program: Use the Node.js command-line tool to execute our script.

Step 1: Install Node.js

Before we start coding, make sure you have Node.js installed. You can download it from the official Node.js website. The installation process is straightforward and includes npm (Node Package Manager), which will be useful for managing packages in your projects.

Terminal
$ node -v
$ npm -v

These commands check if Node.js and npm are installed correctly. You should see the version numbers of Node.js and npm as output.

Step 2: Create a JavaScript File

Now, let's create a new file for our "Hello, World!" program. Open your favorite code editor and create a file named hello.js.

JavaScript
1// hello.js
2console.log('Hello, World!');

This script uses the console.log() function to print "Hello, World!" to the console.

Step 3: Run the Program

With our script ready, we can run it using Node.js. Open your terminal and navigate to the directory where you saved hello.js. Then, execute the following command:

Terminal

The output will be:

Output

What's Next?

Now that you've created a simple "Hello, World!" program in Node.js, it's time to explore more advanced features. In the next section, we'll dive into Node.js modules, which are essential for building larger applications.

Stay tuned, and happy coding!


PreviousNode.js InstallationNext Node.js Modules

Recommended Gear

Node.js InstallationNode.js Modules