Certified Jenkins Engineer

Setting up CI Pipeline

NodeJS Application Overview

In this lesson, we’ll explore Node.js—an open-source, cross-platform JavaScript runtime—and see how it powers custom GitHub Actions workflows. You’ll learn about its core features, the built-in package manager, and a typical project layout.

What Is Node.js?

Node.js is a JavaScript runtime built on Google’s high-performance V8 engine. It lets you run JavaScript outside the browser, so you can build server-side apps, CLI tools, and more—all with the same language you use in the browser. Node.js supports Windows, macOS, and Linux.

Note

For production environments, use the Long-Term Support (LTS) version of Node.js. Manage multiple versions easily with tools like nvm.

Node Package Manager (npm)

When you install Node.js, you also get npm—the package manager that helps you discover, install, and manage JavaScript libraries and dependencies. With npm you can:

  • Share code with the community via the npm registry
  • Install and update packages with a single command
  • Define project scripts for testing, building, and running your app

Sample Node.js Project Structure

A minimal Node.js project often includes these three files:

FilePurpose
package.jsonMetadata (name, version) and dependency definitions
index.jsApplication entry point and core logic
test.jsAutomated tests for your code

To set up your project:

# Install all dependencies listed in package.json
npm install

After installation, npm creates a node_modules folder with all packages you need.

Common npm Commands

CommandDescription
npm installInstall project dependencies
npm testRun tests defined in test.js
npm startLaunch the application (e.g., server)
# Verify your environment
$ node -v
v18.16.0
$ npm -v
9.8.1

# Install dependencies
$ npm install

# Run tests
$ npm test

# Start the application
$ npm start
App listening on port 3000

Once the application is running, open your browser and navigate to http://localhost:3000.

Watch Video

Watch video content

Previous
Demo Email Extention Notification Pipeline