mko
mko

Reputation: 7325

Using npm in asp.net core

Why should I use npm with asp.net core? Is there a difference between using npm and adding client-side libs like this?

enter image description hereenter image description here

Upvotes: 1

Views: 2088

Answers (1)

itminus
itminus

Reputation: 25370

Why should I use npm with asp.net core?

If your ASP.NET Core project has no dependency on any npm packages such as React.js/ Angular/ Vue/ e.t.c, you don't need to use npm to install client dependencies at all (Simply Pay as you go).

Is there a difference between using npm and adding client-side libs like this?

Yes.

The second way is invoking LibMan instead of the npm behind the scenes.

As the official document describes, LibMan is a lightweight tool written in C# to download popular libraries. When dealing with dependencies, LibMan is similar to npm in some way.

However, Libman will download libraries from CDNs(including CDNJS and unpkg) instead of from npmjs or other npm repositories.

Also, it's easy to custom the path of your dependency files. There's no need to copy files from node_modules/.

Upvotes: 2

Related Questions