liveBook · Manning

Node.js

As explained in Road to Kubernetes

A runtime platform for executing JavaScript outside a web browser, commonly for server-side applications.

Node.js is a runtime for executing JavaScript on a server rather than inside a web browser. Express.js builds lightweight server-side web applications on top of it. section 2.2

A basic Node.js project uses npm to create and manage its local application environment:

  • Run npm init in the project root to create package.json. section 2.2
  • Install Express.js with npm install express. section 2.2
  • Use package.json to record installed dependencies and support repeatable environments. section 2.5
Listing 2.12 Initializing a new Node.js project
npm init

Use the npm init command to begin a Node.js project and generate its package.json configuration. section 2.2

Run the application on different ports

Start the Express.js server with node main.js; it runs at http://127.0.0.1:3000. Set PORT=3011 before the command to run it at http://127.0.0.1:3011 instead. Stop the process with Control+C. section 2.2.2

Node.js applications provide a practical deployment target before containerization. Consistent dependency tracking helps package and deploy the same application across environments. section 2.0 section 2.5

How Road to Kubernetes covers it

How deep it goes
Explains the runtime distinction, npm setup, dependency tracking, server execution, and port configuration without covering deployment internals.
Examples
Uses an Express.js application, npm project initialization, package.json, and servers running on ports 3000 and 3011.
What it assumes
Assumes basic JavaScript familiarity while teaching server-side JavaScript, npm setup, and local dependency isolation.
What you can do after
Build it from scratch with npm and Express.js, run the server, change its port, and track its dependencies.
How it connects
Connects Node.js with JavaScript, Express.js, npm, package.json, HTTP, web applications, and containerization.

Also explained in

Compare how 4 books explain Node.js →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.