.NET Core Middleware bridge for NPM

The late, great .Net guru K Scott Allen created and supported a middleware bridge for .Net Core projects that provide support for using NPM modules (“package.json”) in .Net projects.   This NuGet library will install the support for you.

What it will get you is the ability to reference external libraries such as jQuery and bootstrap within a web project in .Net Core.

Usage is quite simple.  Simply pull the package down via NuGet, install your npm packages and then add this simple line in startup.cs:

app.UseNodeModules();

That’s it.   Then in your source html and razor pages you can reference the /node_modules directory as if it was a child of the wwwroot folder which is where .Net core normally looks for static files.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s