CodingNeed.
Node.js · Beginner

Node.js from a script to an API

Understand where JavaScript runs, then learn modules, async work, files, HTTP, validation and tests before building an API.

Prerequisite: JavaScript foundations: functions, objects, arrays and callbacks. No TypeScript required. · 161 minutes of guided study

Start here before the intermediate framework labs. Each example is self-contained; replace the previous example instead of pasting them together.

Start first lesson →

What you’ll be able to do

  • Run a JavaScript file outside the browser
  • Understand imports and explicit exports
  • Wait for a promise without blocking JavaScript
  • Read and validate a JSON file
  • Receive an HTTP request and return JSON
  • Validate a query parameter at the boundary
  • Write repeatable tests for the logic
  • Project · A small searchable topics API

How to study this course

Follow the numbered modules. Read the example, explain why it works, attempt the exercise, then compare your result with the supplied checks.

Setup: Install Node.js 22.12+ (or a supported newer LTS). Create a folder named codingneed-node. Open a terminal in that folder. Save ONE lesson example as lesson.mjs and run node lesson.mjs. No npm dependencies are required. HTTP lessons keep running until you press Ctrl+C; stop the previous server before starting another.

Times estimate guided reading and practice. Projects and revision can take longer.

Course syllabus · 8 lessons

Essential cookies keep your account signed in. Optional analytics is not configured on this site. Your choice does not affect access to lessons.

Read the Privacy Policy. You can change this choice in the footer.