> For the complete documentation index, see [llms.txt](https://docs.bashschool.in/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bashschool.in/v1/javascript/nodejs/hello-world-in-node.md).

# Hello World in Node

1. Create a JavaScript file named "helloWorld.js"
2. Open your code editor and create a new file. Save this file with the name "helloWorld.js" in your project directory.
3. Write the Hello World program
4. Add the following code to your "helloWorld.js" file:
5. console.log('Hello, World!');
6. This code will print "Hello, World!" to the console when run.
7. Open your terminal or command prompt
8. Navigate to the directory where your "helloWorld.js" file is saved. You can do this by using the 'cd' command followed by the path to your project directory. For example:
9. cd path/to/your/project/directory
10. Make sure to replace "path/to/your/project/directory" with the actual path to your project directory.
11. Run the program
12. With your terminal or command prompt open and navigated to your project directory, run the program by typing the following command:
13. node helloWorld.js

Congratulations! You have just written and run your first Node.js program. Keep experimenting with more code and explore what Node.js has to offer.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bashschool.in/v1/javascript/nodejs/hello-world-in-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
