I agree with all of this. I'll add that if you can add the npm package and include the library as part of your build with the rest of your code, your code should be cleaner. You can rely on imports instead of global variables.
All-in-all I'd call the CDN a quick and dirty version or a good solution depending on your needs, but when in doubt, make it part of your package.json.
Disclaimer: I'm always uncertain about anything in JS land these days π
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree with all of this. I'll add that if you can add the npm package and include the library as part of your build with the rest of your code, your code should be cleaner. You can rely on imports instead of global variables.
All-in-all I'd call the CDN a quick and dirty version or a good solution depending on your needs, but when in doubt, make it part of your
package.json
.Disclaimer: I'm always uncertain about anything in JS land these days π