Whats the diff between cdnjs vs npmjs

2019-05-14 01:44发布

问题:

What is the difference between cdnjs vs npmjs? Im new to Javascript and programming in general so this probably is a real newb question and there's probably a real big difference.

But what is it, the difference? And is npm a type of CDN (content delivery network)?

回答1:

npmjs(Node Package Manager) is repository consisting node modules/packages. you can search and download node modules from there.

cdnjs is Content Delivery Network for JavaScript library files. You can add reference of JavaScript libraries from cdnjs without requiring them to be on your server.



回答2:

npmjs == node js deps // server side

CDN == your browser deps // client side

in simple words