DEV Community

Cover image for Angular vs NPM vs Node.js
Davide Bellone
Davide Bellone

Posted on • Originally published at code4it.dev on

1 1

Angular vs NPM vs Node.js

There's a lot of confusion about Node.js, NPM and Angular. These 3 "entities" are often used together, especially for Angular applications, but they are not the same thing.

Let's make it clear!

Typical structure of an Angular Application

Node.js

Node.js is a server environment based on JavaScript. You can download it from the official site and run it on Windows, Linux, Mac, etc.

Node.js uses asynchronous programming: while a typical server handles one request per time (thus creating overhead while waiting for the request completion), Node.js accepts all the request and handles them one by one in a manner that does not block other requests. This is obviously very efficient.

NPM

NPM is the package manager for Node.js packages. It contains thousands of free packages available to download; also, via command line, it's easy to download and update those packages.

NPM is commonly used with Node.js, so it is installed with the server environment.

The way to install a package is with the command npm install <package_name>.

Angular

Angular is a framework based on JavaScript that makes it easy to build applications for the web. Often you'll see Angular applications written in Typescript, a modern class-oriented language based on JavaScript. The result is the same: Typescript is compiled into JavaScript, so they are interchangeable. Well, at least the latest versions of JS, because types and decorators are required in order to, respectively, use dependency injection and set metadata.

Being based on JavaScript - guess what? - it fits perfectly with Node.js. And of course NPM, that allows you to download JavaScript packages to include in the project.

Wrapping up

Now we know what Node.js, NPM and Angular are, and how they fit together.

Node.js is just the server that handles the requests from the web page; these pages can call web APIs from whatever kind of server, and of course look up to data in any type of DB.

Neon image

Serverless Postgres in 300ms (❗️)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Top comments (0)

AWS Industries LIVE! Stream

Watch AWS Industries LIVE!

Watch Industries LIVE! to find out how the AWS cloud helps solve real-world business challenges.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay