A first introduction to Node.js, exploring how to initialize a project, execute JavaScript files from the terminal and automate script execution with npm.
| Repository | Project | Category | Main Focus | Exercise |
|---|---|---|---|---|
| node-hello-world | Node Hello World | Exercise | Node.js, npm scripts | 42/50 |
Create your first Node.js application and learn how to run JavaScript files outside the browser.
Create a new Node.js project and initialize it.
npm initCreate a server.js file that prints the following message in the terminal:
Hello World
Run the file directly from the terminal using basic Node.js commands.
Add a start script to package.json to execute the application.
npm run startAdd a watch script to package.json that automatically restarts the application whenever the source file changes.
Run the script.
npm run watchModify the code so that it prints:
Hello Boolean
The terminal should display the updated message automatically, without manually stopping and restarting the application.
Experiment with process.argv, the array containing the command-line arguments passed to the Node.js process. Explore how to access and use these arguments within your application.
- Initializing a Node.js project with npm.
- Executing JavaScript files using Node.js.
- Configuring scripts in
package.json. - Running application scripts with npm.
- Automating application restarts with watch mode.
- Exploring command-line arguments with
process.argv.
Exercise assigned by Boolean Tech Academy as part of the Web Development course (Class 152, A.Y. 2025-2026).