how to get the url for a package in npmjs.com instead of installing with npm

1.7k Views Asked by At

I am creating a reactjs based html page.

I want to use normalizr for my data.

I can get the reactjs directly in the html by the following:

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>

But how to get normalizr. I didnt find any such link. Because it says to install using npm.

I want to directly use in the html like reactjs as above so is it possible

2

There are 2 best solutions below

2
On BEST ANSWER

You can use unpkg to any file from any npm library as a link.

For normalizr, the URL would be

https://unpkg.com/[email protected]/dist/normalizr.min.js

If you need any other file from normalizer repo, you can file the link for the file here

https://unpkg.com/[email protected]/dist/

unpkg is super-fast and better than most cdns out there.

2
On

Apart from normalizer, you can also use:

npm-cdn

https://npm-cdn.herokuapp.com/[email protected]/dist/normalizr.min.js