> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NodeJS Application Overview

> This article provides an overview of Node.js, its features, npm, and a typical project structure for building applications.

In this lesson, we’ll explore [Node.js][Node.js]—an open-source, cross-platform JavaScript runtime—and see how it powers custom [GitHub Actions][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][Node.js] is a JavaScript runtime built on Google’s high-performance [V8 engine][V8]. 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.

<Callout icon="lightbulb" color="#1CB2FE">
  For production environments, use the Long-Term Support (LTS) version of Node.js. Manage multiple versions easily with tools like [nvm](https://github.com/nvm-sh/nvm).
</Callout>

## Node Package Manager (npm)

When you install Node.js, you also get [npm][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:

| File         | Purpose                                             |
| ------------ | --------------------------------------------------- |
| package.json | Metadata (name, version) and dependency definitions |
| index.js     | Application entry point and core logic              |
| test.js      | Automated tests for your code                       |

To set up your project:

```bash theme={null}
# 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

| Command     | Description                           |
| ----------- | ------------------------------------- |
| npm install | Install project dependencies          |
| npm test    | Run tests defined in `test.js`        |
| npm start   | Launch the application (e.g., server) |

```bash theme={null}
# 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](http://localhost:3000).

## Links and References

* [Node.js][Node.js]
* [npm][npm]
* [V8 JavaScript Engine][V8]
* [GitHub Actions][GitHub Actions]

[Node.js]: https://nodejs.org/

[npm]: https://www.npmjs.com/

[V8]: https://v8.dev/

[GitHub Actions]: https://docs.github.com/en/actions

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/certified-jenkins-engineer/module/73d0066f-a01f-4d13-a00c-c9baf9aae603/lesson/6609d621-3a6f-41b6-9baa-cdaff475ca02" />
</CardGroup>
