Skip to content

Show what you Node?

Professor Solo says:

“Alright, coders. You’ve got your hard hat (Node.js) and your tool belt (NPM). But before we construct the scaffolding, we need to verify your gear. This is the Blueprint Audit.”

Blueprint Audit

First things first. Let’s make sure your tools aren’t made of plastic. Open your terminal (that’s your job site from now on).

  1. Check your Node engine.

    Terminal window
    node -v

    You should see a version number like v22.x.x or higher.

  2. Check your Package Manager.

    Terminal window
    npm -v

    If this errors out, you didn’t install the tool belt properly.

Before we write permanent blueprints (files), we test in the sandbox. Enter the Read-Eval-Print Loop.

Terminal window
node

You should see the welcome caret: >

Complete these challenges strictly inside the REPL:

  1. Calculate the materials: Multiply 124 by 8.
  2. String construction: Create a constant const name = "Rookie".
  3. Yelling match: Convert that name to uppercase using .toUpperCase().
  4. Exit strategy: How do you get out? (Hint: .exit or Ctrl+C twice).

The REPL is for scribbles. Scripts are for blueprints. Let’s create your first official “Site Manifest”.

  1. Create a file named manifest.js.

  2. Add this code to handle command line arguments:

    manifest.js
    const args = process.argv.slice(2);
    const username = args[0] || "Stranger";
    console.log(`👷 Site Foreman: Welcome to the job site, ${username}.`);
    console.log(" Get your hard hat on. We have work to do.");
  3. Run it with your name:

    Terminal window
    node manifest.js YourName

Every good site needs a status report. Node comes with built-in tools (Modules) so you don’t have to build a hammer from scratch.

  1. Modify your manifest.js to include the OS Module:

    const os = require("os");
    // ... previous code ...
    console.log("-----------------------------------------");
    console.log(`🖥️ System Uptime: ${os.uptime()} seconds`);
    console.log(`🏠 Home Directory: ${os.homedir()}`);
    console.log("-----------------------------------------");
  2. Run it again. Watch the data pour in.


Before you clock out, verify you have:

  • Passed the node -v check.
  • Played in the REPL (and escaped it!).
  • Created manifest.js.
  • Successfully ran node manifest.js [YourName].
  • Saw your System Uptime logged to the console.

Want to dig deeper? Try these experiments with your AI assistant.

Paste your manifest.js code into an AI and ask:

“Explain how process.argv works in this code like I’m 10 years old. Draw a diagram of the array indices.”

We used os.uptime(). Ask an AI:

“What are 3 other cool methods in the Node.js os module that I can use to get info about my computer? Give me code examples.”

Copy this broken code into a new file called broken.js. It will crash. Try to fix it yourself first by reading the error message. If you get stuck, paste the error into an AI.

broken.js
console.log("Checking system memory...");
console.log(`Total Memory: ${os.totalmem()}`); // Error!
console.log("System check complete.");

Hint: Did we forget to visit the supply closet?

“Great work, engineers. Take a break. Next, we hit the Node.js expressway.”Professor Solo